summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/Abhinav_Demos/Column.sci26
-rw-r--r--demos/Abhinav_Demos/Row.sci25
-rw-r--r--demos/Abhinav_Demos/deviation.sci41
-rw-r--r--demos/Abhinav_Demos/is_matrix.sci41
-rw-r--r--demos/Abhinav_Demos/matrixreshape.sci18
-rw-r--r--demos/Abhinav_Demos/med.sci66
-rw-r--r--demos/Abhinav_Demos/modula.sci57
-rw-r--r--demos/Abhinav_Demos/nan_max.sci33
-rw-r--r--demos/Abhinav_Demos/nonzero.sci15
-rw-r--r--demos/Abhinav_Demos/nthroot1.sci23
-rw-r--r--demos/Abhinav_Demos/scalar.sci12
-rw-r--r--demos/Abhinav_Demos/square.sci13
-rw-r--r--demos/Abhinav_Demos/vector.sci16
13 files changed, 386 insertions, 0 deletions
diff --git a/demos/Abhinav_Demos/Column.sci b/demos/Abhinav_Demos/Column.sci
new file mode 100644
index 0000000..b9dc55b
--- /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/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
diff --git a/demos/Abhinav_Demos/deviation.sci b/demos/Abhinav_Demos/deviation.sci
new file mode 100644
index 0000000..99eb5b1
--- /dev/null
+++ b/demos/Abhinav_Demos/deviation.sci
@@ -0,0 +1,41 @@
+function deviation()
+
+a=[ 211.128 2912 4.12 123 ; 53211 12.312 21 0]
+disp('Double')
+
+disp(mad(a, 'r'))
+disp('')
+
+disp(mad(a, 'c'))
+disp('')
+
+disp(mad(a))
+disp('')
+
+disp('Float')
+
+b= float(a)
+disp(mad(b, 'r'))
+disp('')
+
+disp(mad(b, 'c'))
+disp('')
+
+disp(mad(b))
+disp('')
+
+
+disp('DoubleComplex')
+
+c= [%i*971+ 231, 87+%i*16, 2400+%i*1721; 981,0, %i*1213]
+disp(mad(c, 'r'))
+disp('')
+
+disp(mad(c, 'c'))
+disp('')
+
+disp(mad(c))
+disp('')
+
+endfunction
+
diff --git a/demos/Abhinav_Demos/is_matrix.sci b/demos/Abhinav_Demos/is_matrix.sci
new file mode 100644
index 0000000..540189e
--- /dev/null
+++ b/demos/Abhinav_Demos/is_matrix.sci
@@ -0,0 +1,41 @@
+
+// Test file for "ismatrix" function for the data types double, float, double complex, uint16, string
+
+function is_matrix()
+ disp('Double')
+ a= [1 ,25, 52]
+ disp(ismatrix(a))
+ disp('')
+ b=1.2131
+ disp(ismatrix(b))
+ disp('')
+
+ disp('Float')
+ c=float(a)
+ disp(ismatrix(c))
+ disp('')
+ d=float(b)
+ disp(ismatrix(d))
+ disp('')
+
+ disp('String')
+ e= ['af' 'as' '12'; '121' 'king' 'queen' ]
+ disp(ismatrix(e))
+ disp('')
+ f='Light'
+ disp(ismatrix(f))
+ disp('')
+
+ disp('doubleComplex')
+ g=[%i*2; %i*91+100]
+ disp(ismatrix(g))
+ disp('')
+ h= %i*98.12 + 121
+ disp(ismatrix(h))
+ disp('')
+
+ disp('Uint16')
+ i= [12, 231 ,213, 123]
+ disp(ismatrix(i))
+ disp('')
+endfunction
diff --git a/demos/Abhinav_Demos/matrixreshape.sci b/demos/Abhinav_Demos/matrixreshape.sci
new file mode 100644
index 0000000..38fa0a5
--- /dev/null
+++ b/demos/Abhinav_Demos/matrixreshape.sci
@@ -0,0 +1,18 @@
+
+// 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/med.sci b/demos/Abhinav_Demos/med.sci
new file mode 100644
index 0000000..821ca1f
--- /dev/null
+++ b/demos/Abhinav_Demos/med.sci
@@ -0,0 +1,66 @@
+function med()
+
+a=float([12,287,312,52; 4,5,456,512; 12, 4, 6,213])
+
+
+disp('Float')
+
+
+disp(median(a, 'r'))
+disp('')
+
+disp(median(a, 'c'))
+disp('')
+
+disp(median(a))
+disp('')
+
+
+b=[12,287,312,52; 4,5,456,512; 12, 4, 6,213]
+
+
+disp('Double')
+
+
+disp(median(b, 'r'))
+disp('')
+
+disp(median(b, 'c'))
+disp('')
+
+disp(median(b))
+disp('')
+
+
+
+disp('uint16')
+
+
+c=uint16([12,287,312,52; 4,5,456,512; 12, 4, 6,213])
+disp(median(c, 'r'))
+disp('')
+
+disp(median(c, 'c'))
+disp('')
+
+disp(median(c))
+disp('')
+
+
+disp('doubleComplex')
+
+
+d= [%i*21, 65+%i*7, %i*121, 56; %i*6112, 12 ,3, 0]
+disp(median(d, 'r'))
+disp('')
+
+disp(median(d, 'c'))
+disp('')
+
+disp(median(d))
+disp('')
+
+
+
+endfunction
+
diff --git a/demos/Abhinav_Demos/modula.sci b/demos/Abhinav_Demos/modula.sci
new file mode 100644
index 0000000..8f56e6c
--- /dev/null
+++ b/demos/Abhinav_Demos/modula.sci
@@ -0,0 +1,57 @@
+function modula()
+
+a=312
+b=18.12
+disp('Double')
+
+disp(pmodulo(a,b))
+
+disp(pmodulo(a,-b))
+
+disp(pmodulo(-a,b))
+
+disp(pmodulo(-a,-b))
+
+k=[12 , -134 , 1213; -12.12, -0.12, 91281]
+l=[12, ,1212 ,12; -91288.12, -0.912, -10000]
+
+disp(pmodulo(k,l))
+
+disp('Float')
+c= float(312)
+d=float(121.212)
+
+disp(pmodulo(c,d))
+
+disp(pmodulo(c,-d))
+
+disp(pmodulo(-c,d))
+
+disp(pmodulo(-c,-d))
+
+e=float([12 , -134 , 1213; -12.12, -0.12, 91281])
+f=float([12, ,1212 ,12; -91288.12, -0.912, -10000])
+
+disp( pmodulo(e,f))
+
+disp('Uint16')
+
+g= int16(112)
+h= int16(121)
+
+disp(pmodulo(g,h))
+
+disp(pmodulo(g,-h))
+
+disp(pmodulo(-g,h))
+
+disp(pmodulo(-g,-h))
+
+i= int16([12 , -134 , 1213; -12.12, -12.54, 91281])
+
+j= int16([12, ,1212 ,12; 1121, -6000, -10000])
+disp( pmodulo(i,j))
+
+
+endfunction
+
diff --git a/demos/Abhinav_Demos/nan_max.sci b/demos/Abhinav_Demos/nan_max.sci
new file mode 100644
index 0000000..769a92a
--- /dev/null
+++ b/demos/Abhinav_Demos/nan_max.sci
@@ -0,0 +1,33 @@
+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('')
+
+
+
+
+endfunction
+
diff --git a/demos/Abhinav_Demos/nonzero.sci b/demos/Abhinav_Demos/nonzero.sci
new file mode 100644
index 0000000..14a1416
--- /dev/null
+++ b/demos/Abhinav_Demos/nonzero.sci
@@ -0,0 +1,15 @@
+
+// Test file for "nonzero" function for the data types double, float, double complex, uint16
+
+function nonzero()
+ 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/nthroot1.sci
new file mode 100644
index 0000000..201338b
--- /dev/null
+++ b/demos/Abhinav_Demos/nthroot1.sci
@@ -0,0 +1,23 @@
+// 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/scalar.sci b/demos/Abhinav_Demos/scalar.sci
new file mode 100644
index 0000000..6b280ea
--- /dev/null
+++ b/demos/Abhinav_Demos/scalar.sci
@@ -0,0 +1,12 @@
+// Test file for "isscalar" function for the data types double, float, double complex.
+function scalar()
+ a=[1,2,3,4]
+ disp(isscalar(a))
+ b= float(a)
+ disp(isscalar(b))
+ c= %i*2+34
+ disp(isscalar(c))
+
+
+
+endfunction
diff --git a/demos/Abhinav_Demos/square.sci b/demos/Abhinav_Demos/square.sci
new file mode 100644
index 0000000..172f73c
--- /dev/null
+++ b/demos/Abhinav_Demos/square.sci
@@ -0,0 +1,13 @@
+// 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 square()
+ a=[1,2,3,4; 5,6,7,8; 98,162,6587,0]
+ disp(issquare(a))
+ disp('')
+ b= [%i+25, 1, %i*5+12]
+ disp(issquare(b))
+ disp('')
+
+endfunction
diff --git a/demos/Abhinav_Demos/vector.sci b/demos/Abhinav_Demos/vector.sci
new file mode 100644
index 0000000..dedd8f1
--- /dev/null
+++ b/demos/Abhinav_Demos/vector.sci
@@ -0,0 +1,16 @@
+// Test file for "vector" function for the data types double, float, double complex.
+function vector()
+ a=[1,2,3,4]
+ disp(isvector(a))
+ disp('')
+ b= %i+2
+ disp(isvector(b))
+ disp('')
+ c= float([1,3,4;1,2,3])
+ disp(isvector(c))
+ disp('')
+ d= [%i*812; %i*12]
+ disp(isvector(d))
+ disp('')
+
+endfunction