summaryrefslogtreecommitdiff
path: root/2.3-1/demos/Abhinav_Demos/nan_cumsum.sci
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/demos/Abhinav_Demos/nan_cumsum.sci')
-rw-r--r--2.3-1/demos/Abhinav_Demos/nan_cumsum.sci35
1 files changed, 35 insertions, 0 deletions
diff --git a/2.3-1/demos/Abhinav_Demos/nan_cumsum.sci b/2.3-1/demos/Abhinav_Demos/nan_cumsum.sci
new file mode 100644
index 00000000..c5943a0f
--- /dev/null
+++ b/2.3-1/demos/Abhinav_Demos/nan_cumsum.sci
@@ -0,0 +1,35 @@
+function nan_cumsum ()
+ x= [1 %nan 1 0.8; 21 1 13 %nan]
+ disp('Double')
+ a= nancumsum(x)
+ disp(a)
+ disp('')
+ b= nancumsum(x, 'r')
+ disp(b)
+ disp('')
+ c= nancumsum(x,'c')
+ disp(c)
+ disp('')
+ y= float(x)
+ disp('Float')
+ d= nancumsum(y)
+ disp(d)
+ disp('')
+ e= nancumsum(y, 'r')
+ disp(e)
+ disp('')
+ f= nancumsum(y,'c')
+ disp(f)
+ disp('')
+ z= [%nan , 12, 1219, %nan + %i*121; 121 %nan 90 12]
+ disp('DoubleComplex')
+ g= nancumsum(z)
+ disp(g)
+ disp('')
+ h= nancumsum(z, 'r')
+ disp(h)
+ disp('')
+ i= nancumsum(z,'c')
+ disp(i)
+ disp('')
+endfunction