diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/Abhinav_Demos/column.sci (renamed from demos/Abhinav_Demos/Column.sci) | 2 | ||||
-rw-r--r-- | demos/Abhinav_Demos/matrix_reshape.sci (renamed from demos/Abhinav_Demos/matrixreshape.sci) | 2 | ||||
-rw-r--r-- | demos/Abhinav_Demos/nan_max.sci | 74 | ||||
-rw-r--r-- | demos/Abhinav_Demos/nan_median.sci | 31 | ||||
-rw-r--r-- | demos/Abhinav_Demos/nan_sum.sci | 35 | ||||
-rw-r--r-- | demos/Abhinav_Demos/non_zero.sci | 15 | ||||
-rw-r--r-- | demos/Abhinav_Demos/nth_root.sci (renamed from demos/Abhinav_Demos/nthroot1.sci) | 2 | ||||
-rw-r--r-- | demos/Abhinav_Demos/row.sci (renamed from demos/Abhinav_Demos/Row.sci) | 0 |
8 files changed, 126 insertions, 35 deletions
diff --git a/demos/Abhinav_Demos/Column.sci b/demos/Abhinav_Demos/column.sci index b9dc55b..8220987 100644 --- a/demos/Abhinav_Demos/Column.sci +++ b/demos/Abhinav_Demos/column.sci @@ -3,7 +3,7 @@ //The function written doesn't work for string or character scalar as of now. -function Column() +function column() a=[1,2,3,4; 5,6,7,8; 98,162,6587,0] disp( iscolumn(a)) disp('') diff --git a/demos/Abhinav_Demos/matrixreshape.sci b/demos/Abhinav_Demos/matrix_reshape.sci index 38fa0a5..bf7fbbc 100644 --- a/demos/Abhinav_Demos/matrixreshape.sci +++ b/demos/Abhinav_Demos/matrix_reshape.sci @@ -1,7 +1,7 @@ // Test file for "matrix" function for the data types double, float, double complex, uint16 -function matrixreshape() +function matrix_reshape() a=[1,2,3,4;5,6,7,8;8,9,1,2] b=float(a) c= uint16(b) diff --git a/demos/Abhinav_Demos/nan_max.sci b/demos/Abhinav_Demos/nan_max.sci index 769a92a..c840e06 100644 --- a/demos/Abhinav_Demos/nan_max.sci +++ b/demos/Abhinav_Demos/nan_max.sci @@ -1,33 +1,43 @@ -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= [1 %nan 1 0.8; 21 1 13 %nan] + disp('Double') + a= nanmax(x) + disp(a) + disp('') + [b,c]= nanmax(x) + disp(b) + disp('') + disp(c) + disp('') + d= nanmax(x) + disp(d) + disp('') + e=nanmax(x,'r') + f=nanmax(x,'c') + disp(e) + disp('') + disp(f) + disp('') + + y= float(x) + disp('Float') + g= nanmax(y) + disp(g) + disp('') + [h,i]= nanmax(y) + disp(h) + disp('') + disp(i) + disp('') + j= nanmax(y) + disp(j) + disp('') + k=nanmax(y,'r') + l=nanmax(y,'c') + disp(k) + disp('') + disp(l) + disp('') + + endfunction - diff --git a/demos/Abhinav_Demos/nan_median.sci b/demos/Abhinav_Demos/nan_median.sci new file mode 100644 index 0000000..f2b350c --- /dev/null +++ b/demos/Abhinav_Demos/nan_median.sci @@ -0,0 +1,31 @@ +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/nan_sum.sci b/demos/Abhinav_Demos/nan_sum.sci new file mode 100644 index 0000000..b6d1017 --- /dev/null +++ b/demos/Abhinav_Demos/nan_sum.sci @@ -0,0 +1,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 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/nthroot1.sci b/demos/Abhinav_Demos/nth_root.sci index 201338b..13e4223 100644 --- a/demos/Abhinav_Demos/nthroot1.sci +++ b/demos/Abhinav_Demos/nth_root.sci @@ -1,7 +1,7 @@ // Test file for "nthroot" function for the data types double, float, double complex. -function nthroot1() +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) diff --git a/demos/Abhinav_Demos/Row.sci b/demos/Abhinav_Demos/row.sci index 264b174..264b174 100644 --- a/demos/Abhinav_Demos/Row.sci +++ b/demos/Abhinav_Demos/row.sci |