File: ex2c.sce

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (30 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Example with optional argument specified with the 
// arg=value syntax
// [a,b,c] = ex2c(x1,{ v1= arg1, v2=arg2}) , arg1 default value 99
//					       arg2 default value 3
// only v1 and v2 are recognized as optional argument names 
// the return value are a<--x1, b = 2*v2 , c = 3*v2 
//

[a,b,c]=ex2c('test');

if norm([99*2,3*3]-[b,c]) > %eps then pause,end

[a,b,c]=ex2c('test',v1=[10,20]);

if norm([[10,20]*2,3*3]-[b,c]) > %eps then pause,end

[a,b,c]=ex2c('test',v1=[10,20],v2=8);

if norm([[10,20]*2,8*3]-[b,c]) > %eps then pause,end

[a,b,c]=ex2c('test',v2=8,v1=[10]);

if norm([10*2,8*3]-[b,c]) > %eps then pause,end