From 9b3788e3f1b061bee62ad14c0bfbd7dfd64fbd01 Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Thu, 27 Jul 2017 18:16:59 +0530 Subject: Nan Median Added --- demos/Abhinav_Demos/Column.sci | 26 ---------------------- demos/Abhinav_Demos/Row.sci | 25 --------------------- demos/Abhinav_Demos/column.sci | 26 ++++++++++++++++++++++ demos/Abhinav_Demos/matrix_reshape.sci | 18 +++++++++++++++ demos/Abhinav_Demos/matrixreshape.sci | 18 --------------- demos/Abhinav_Demos/nan_max.sci | 40 +++++++--------------------------- demos/Abhinav_Demos/nan_median.sci | 33 ++++++++++++++++++++++++++++ demos/Abhinav_Demos/non_zero.sci | 15 +++++++++++++ demos/Abhinav_Demos/nth_root.sci | 23 +++++++++++++++++++ demos/Abhinav_Demos/nthroot1.sci | 23 ------------------- demos/Abhinav_Demos/row.sci | 25 +++++++++++++++++++++ 11 files changed, 148 insertions(+), 124 deletions(-) delete mode 100644 demos/Abhinav_Demos/Column.sci delete mode 100644 demos/Abhinav_Demos/Row.sci create mode 100644 demos/Abhinav_Demos/column.sci create mode 100644 demos/Abhinav_Demos/matrix_reshape.sci delete mode 100644 demos/Abhinav_Demos/matrixreshape.sci create mode 100644 demos/Abhinav_Demos/nan_median.sci create mode 100644 demos/Abhinav_Demos/non_zero.sci create mode 100644 demos/Abhinav_Demos/nth_root.sci delete mode 100644 demos/Abhinav_Demos/nthroot1.sci create mode 100644 demos/Abhinav_Demos/row.sci (limited to 'demos') diff --git a/demos/Abhinav_Demos/Column.sci b/demos/Abhinav_Demos/Column.sci deleted file mode 100644 index b9dc55b..0000000 --- a/demos/Abhinav_Demos/Column.sci +++ /dev/null @@ -1,26 +0,0 @@ -// Test file for "Column" function for the data types double, float, double complex, string , uint16. -// All the below statements are added to initialize variables in different data types -//The function written doesn't work for string or character scalar as of now. - - -function Column() - a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] - disp( iscolumn(a)) - disp('') - b= float(a) - disp(iscolumn(b)) - c= [1,2,34,5] - d= uint16(c) - disp(iscolumn(d)) - disp('') - f= [1;2;3;4] - disp(iscolumn(f)) - disp('') - u= uint16(c) - disp(iscolumn(u)) - disp('') - g= [%i] - disp(iscolumn(g)) - disp('') - -endfunction diff --git a/demos/Abhinav_Demos/Row.sci b/demos/Abhinav_Demos/Row.sci deleted file mode 100644 index 264b174..0000000 --- a/demos/Abhinav_Demos/Row.sci +++ /dev/null @@ -1,25 +0,0 @@ -// Test file for "Column" function for the data types double, float, double complex, string , uint16. -// All the below statements are added to initialize variables in different data types -//The function written doesn't work for string or character scalar as of now. - - -function Row() - a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] - disp( isrow(a)) - disp('') - b= float(a) - disp(isrow(b)) - c= [1,2,34,5] - d= uint16(c) - disp(isrow(d)) - disp('') - f= [1;2;3;4] - disp(isrow(f)) - disp('') - u= uint16(c) - disp(isrow(u)) - disp('') - g= [%i*1; 7] - disp(isrow(g)) - disp('') -endfunction diff --git a/demos/Abhinav_Demos/column.sci b/demos/Abhinav_Demos/column.sci new file mode 100644 index 0000000..8220987 --- /dev/null +++ b/demos/Abhinav_Demos/column.sci @@ -0,0 +1,26 @@ +// Test file for "Column" function for the data types double, float, double complex, string , uint16. +// All the below statements are added to initialize variables in different data types +//The function written doesn't work for string or character scalar as of now. + + +function column() + a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] + disp( iscolumn(a)) + disp('') + b= float(a) + disp(iscolumn(b)) + c= [1,2,34,5] + d= uint16(c) + disp(iscolumn(d)) + disp('') + f= [1;2;3;4] + disp(iscolumn(f)) + disp('') + u= uint16(c) + disp(iscolumn(u)) + disp('') + g= [%i] + disp(iscolumn(g)) + disp('') + +endfunction diff --git a/demos/Abhinav_Demos/matrix_reshape.sci b/demos/Abhinav_Demos/matrix_reshape.sci new file mode 100644 index 0000000..bf7fbbc --- /dev/null +++ b/demos/Abhinav_Demos/matrix_reshape.sci @@ -0,0 +1,18 @@ + +// Test file for "matrix" function for the data types double, float, double complex, uint16 + +function matrix_reshape() + a=[1,2,3,4;5,6,7,8;8,9,1,2] + b=float(a) + c= uint16(b) + d=[%i*2,3,4,5;%i+34,45,32,23; 1,%i*54,8690,1] + +double1= matrix(a,4,3) +float1= matrix (b,4,3) +uint161= matrix(c,4,3) +complex1= matrix(d,4,3) +disp( double1) +disp( float1) +disp( uint161) +disp( complex1) +endfunction diff --git a/demos/Abhinav_Demos/matrixreshape.sci b/demos/Abhinav_Demos/matrixreshape.sci deleted file mode 100644 index 38fa0a5..0000000 --- a/demos/Abhinav_Demos/matrixreshape.sci +++ /dev/null @@ -1,18 +0,0 @@ - -// Test file for "matrix" function for the data types double, float, double complex, uint16 - -function matrixreshape() - a=[1,2,3,4;5,6,7,8;8,9,1,2] - b=float(a) - c= uint16(b) - d=[%i*2,3,4,5;%i+34,45,32,23; 1,%i*54,8690,1] - -double1= matrix(a,4,3) -float1= matrix (b,4,3) -uint161= matrix(c,4,3) -complex1= matrix(d,4,3) -disp( double1) -disp( float1) -disp( uint161) -disp( complex1) -endfunction diff --git a/demos/Abhinav_Demos/nan_max.sci b/demos/Abhinav_Demos/nan_max.sci index 769a92a..ce7e10e 100644 --- a/demos/Abhinav_Demos/nan_max.sci +++ b/demos/Abhinav_Demos/nan_max.sci @@ -1,33 +1,9 @@ -function nan_max() - -x=[%nan 0.121 %nan 0.5 0.8; 0.12 %nan 9 12 %nan] - -disp('Double') - -disp(nanmax(x)) -disp('') - -disp(nanmax(x , 'r')) -disp('') - -disp(nanmax(x, 'c')) -disp('') - -y= uint16(x) - -disp('Float') - -disp(nanmax(y)) -disp('') - -disp(nanmax(y , 'r')) -disp('') - -disp(nanmax(y, 'c')) -disp('') - - - - +function nan_max + x= double([1 2 1 0.8; 21 1 13 0.1]) + [a,b]= nanmin(x) + disp(a) + disp('') + disp(b) + disp('') + endfunction - diff --git a/demos/Abhinav_Demos/nan_median.sci b/demos/Abhinav_Demos/nan_median.sci new file mode 100644 index 0000000..993b2d7 --- /dev/null +++ b/demos/Abhinav_Demos/nan_median.sci @@ -0,0 +1,33 @@ +function nan_median() + +x=[%nan 0.121 %nan 0.5 0.8; 0.12 %nan 1 0.9812 %nan; 0.4 0.65 1.08 12 0.1621; 12 12 24 1 12] + +disp('Double') + +disp(nanmedian(x)) +disp('') + +disp(nanmedian(x , 'r')) +disp('') + +disp(nanmedian(x, 'c')) +disp('') + +y= float(x) + +disp('Float') + +disp(nanmedian(y)) +disp('') + +disp(nanmedian(y , 'r')) +disp('') + +disp(nanmedian(y, 'c')) +disp('') + + + + +endfunction + diff --git a/demos/Abhinav_Demos/non_zero.sci b/demos/Abhinav_Demos/non_zero.sci new file mode 100644 index 0000000..3e2b3ba --- /dev/null +++ b/demos/Abhinav_Demos/non_zero.sci @@ -0,0 +1,15 @@ + +// Test file for "nonzero" function for the data types double, float, double complex, uint16 + +function non_zero() + a=[12,4,4; 12,51,6] // double array + disp(nnz(a)) + b=0 //double scalar + disp(nnz(b)) + f= float(a) //float array + disp(nnz(f)) + z=%i*2+0 // doubleComplex scalar + disp(nnz(z)) + + +endfunction diff --git a/demos/Abhinav_Demos/nth_root.sci b/demos/Abhinav_Demos/nth_root.sci new file mode 100644 index 0000000..13e4223 --- /dev/null +++ b/demos/Abhinav_Demos/nth_root.sci @@ -0,0 +1,23 @@ +// Test file for "nthroot" function for the data types double, float, double complex. + + +function nth_root() + b= [1,2,3,4;5,6,7,8] + c=[45,12,4,12; 23,34,5,6] + d= nthroot(b,c) +disp(d) +disp('') +e=34 +f= nthroot(b,e) +disp(f) +disp('') +k=nthroot(3.2123,12) +disp(k) +disp('') + +m= float(b) +l= float(c) +disp(nthroot(m,l)) + + +endfunction diff --git a/demos/Abhinav_Demos/nthroot1.sci b/demos/Abhinav_Demos/nthroot1.sci deleted file mode 100644 index 201338b..0000000 --- a/demos/Abhinav_Demos/nthroot1.sci +++ /dev/null @@ -1,23 +0,0 @@ -// Test file for "nthroot" function for the data types double, float, double complex. - - -function nthroot1() - b= [1,2,3,4;5,6,7,8] - c=[45,12,4,12; 23,34,5,6] - d= nthroot(b,c) -disp(d) -disp('') -e=34 -f= nthroot(b,e) -disp(f) -disp('') -k=nthroot(3.2123,12) -disp(k) -disp('') - -m= float(b) -l= float(c) -disp(nthroot(m,l)) - - -endfunction diff --git a/demos/Abhinav_Demos/row.sci b/demos/Abhinav_Demos/row.sci new file mode 100644 index 0000000..264b174 --- /dev/null +++ b/demos/Abhinav_Demos/row.sci @@ -0,0 +1,25 @@ +// Test file for "Column" function for the data types double, float, double complex, string , uint16. +// All the below statements are added to initialize variables in different data types +//The function written doesn't work for string or character scalar as of now. + + +function Row() + a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] + disp( isrow(a)) + disp('') + b= float(a) + disp(isrow(b)) + c= [1,2,34,5] + d= uint16(c) + disp(isrow(d)) + disp('') + f= [1;2;3;4] + disp(isrow(f)) + disp('') + u= uint16(c) + disp(isrow(u)) + disp('') + g= [%i*1; 7] + disp(isrow(g)) + disp('') +endfunction -- cgit