diff options
author | Abhinav Dronamraju | 2017-08-01 20:22:53 +0530 |
---|---|---|
committer | Abhinav Dronamraju | 2017-08-01 20:22:53 +0530 |
commit | e837bc137eb35bd77e31530436d7727a500d45e0 (patch) | |
tree | e39bf9d85039ac33be87b8ad8661944e9a7327fa /2.3-1/demos/Abhinav_Demos | |
parent | 81419aa6b4f55ae75192f704d2e52dbad3f34033 (diff) | |
download | Scilab2C-e837bc137eb35bd77e31530436d7727a500d45e0.tar.gz Scilab2C-e837bc137eb35bd77e31530436d7727a500d45e0.tar.bz2 Scilab2C-e837bc137eb35bd77e31530436d7727a500d45e0.zip |
Nanstdev, stdev, nancumsum added
Diffstat (limited to '2.3-1/demos/Abhinav_Demos')
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/nan_cumsum.sci | 35 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/nan_stdev.sci | 31 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/std_dev.sci | 20 |
3 files changed, 86 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 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 |