From e837bc137eb35bd77e31530436d7727a500d45e0 Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Tue, 1 Aug 2017 20:22:53 +0530 Subject: Nanstdev, stdev, nancumsum added --- 2.3-1/demos/Abhinav_Demos/nan_cumsum.sci | 35 ++++++++++++++++++++++++++++++++ 2.3-1/demos/Abhinav_Demos/nan_stdev.sci | 31 ++++++++++++++++++++++++++++ 2.3-1/demos/Abhinav_Demos/std_dev.sci | 20 ++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 2.3-1/demos/Abhinav_Demos/nan_cumsum.sci create mode 100644 2.3-1/demos/Abhinav_Demos/nan_stdev.sci create mode 100644 2.3-1/demos/Abhinav_Demos/std_dev.sci (limited to '2.3-1/demos/Abhinav_Demos') 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 diff --git a/2.3-1/demos/Abhinav_Demos/nan_stdev.sci b/2.3-1/demos/Abhinav_Demos/nan_stdev.sci new file mode 100644 index 00000000..0ff5b252 --- /dev/null +++ b/2.3-1/demos/Abhinav_Demos/nan_stdev.sci @@ -0,0 +1,31 @@ +function nan_stdev() + +x=[%nan 0.121 %nan 0.5 0.8; 21.9 %nan 1 0.9812 %nan; 0.12 0.65 1.08 12 0.1621; %nan 12 24 1 12] + +disp('Double') + +disp(nanstdev(x)) +disp('') + +disp(nanstdev(x , 'r')) +disp('') + +disp(nanstdev(x, 'c')) +disp('') + +y= float(x) + +disp('Float') + +disp(nanstdev(y)) +disp('') + +disp(nanstdev(y , 'r')) +disp('') + +disp(nanstdev(y, 'c')) +disp('') + + +endfunction + diff --git a/2.3-1/demos/Abhinav_Demos/std_dev.sci b/2.3-1/demos/Abhinav_Demos/std_dev.sci new file mode 100644 index 00000000..f7dbe41d --- /dev/null +++ b/2.3-1/demos/Abhinav_Demos/std_dev.sci @@ -0,0 +1,20 @@ +// Test file for "Column" function for the data types double, float, double complex, string. +// All the below statements are added to initialize variables in different data types + + +function std_dev() + a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] + disp('Double') + disp(stdev(a)) + disp('') + disp(stdev(a,'r')) + disp('') + disp(stdev(a,'c')) + b=float(a) + disp('Float') + disp(stdev(b)) + disp('') + disp(stdev(b,'r')) + disp('') + disp(stdev(b,'c')) +endfunction -- cgit