summaryrefslogtreecommitdiff
path: root/2.3-1/demos/Abhinav_Demos/nan_sum.sci
blob: b6d10173d3931818c668b637e765b0d849860b66 (plain)
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
31
32
33
34
35
function nan_sum ()
    x= [1 %nan 1 0.8; 21 1 13 %nan]	
	disp('Double')
	a= nansum(x)
	disp(a)
	disp('')
	b= nansum(x, 'r')
	disp(b)
	disp('')
	c= nansum(x,'c')
	disp(c)
	disp('')
    y= float(x)
	disp('Float')
	d= nansum(y)
	disp(d)
	disp('')
	e= nansum(y, 'r')
	disp(e)
	disp('')
	f= nansum(y,'c')
	disp(f)
	disp('')
    z= [%nan , 12, 1219, %nan + %i*121; 121 %nan 90 12]
	disp('DoubleComplex')
	g= nansum(z)
	disp(g)
	disp('')
	h= nansum(z, 'r')
	disp(h)
	disp('')
	i= nansum(z,'c')
	disp(i)
	disp('')
endfunction