diff options
Diffstat (limited to '2.3-1/demos')
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/Column.sci | 26 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/Row.sci | 25 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/deviation.sci | 41 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/is_matrix.sci | 41 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/matrixreshape.sci | 18 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/med.sci | 66 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/modula.sci | 57 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/nan_max.sci | 33 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/nonzero.sci | 15 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/nthroot1.sci | 23 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/scalar.sci | 12 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/square.sci | 13 | ||||
-rw-r--r-- | 2.3-1/demos/Abhinav_Demos/vector.sci | 16 | ||||
-rw-r--r-- | 2.3-1/demos/Brijesh_Demos/Test_Erfcx.sci | 10 | ||||
-rw-r--r-- | 2.3-1/demos/Brijesh_Demos/Test_Erfinv.sci | 10 | ||||
-rw-r--r-- | 2.3-1/demos/RPi/RPi.dem.gateway.sce | 1 | ||||
-rw-r--r-- | 2.3-1/demos/RPi/test_lcd.dem.sce | 19 | ||||
-rw-r--r-- | 2.3-1/demos/scilab2c.dem.gateway.sce | 6 |
18 files changed, 429 insertions, 3 deletions
diff --git a/2.3-1/demos/Abhinav_Demos/Column.sci b/2.3-1/demos/Abhinav_Demos/Column.sci new file mode 100644 index 00000000..b9dc55bd --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/Row.sci b/2.3-1/demos/Abhinav_Demos/Row.sci new file mode 100644 index 00000000..264b174a --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/deviation.sci b/2.3-1/demos/Abhinav_Demos/deviation.sci new file mode 100644 index 00000000..99eb5b1c --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/is_matrix.sci b/2.3-1/demos/Abhinav_Demos/is_matrix.sci new file mode 100644 index 00000000..540189e0 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/matrixreshape.sci b/2.3-1/demos/Abhinav_Demos/matrixreshape.sci new file mode 100644 index 00000000..38fa0a53 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/med.sci b/2.3-1/demos/Abhinav_Demos/med.sci new file mode 100644 index 00000000..821ca1f2 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/modula.sci b/2.3-1/demos/Abhinav_Demos/modula.sci new file mode 100644 index 00000000..8f56e6c1 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/nan_max.sci b/2.3-1/demos/Abhinav_Demos/nan_max.sci new file mode 100644 index 00000000..769a92a7 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/nonzero.sci b/2.3-1/demos/Abhinav_Demos/nonzero.sci new file mode 100644 index 00000000..14a14162 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/nthroot1.sci b/2.3-1/demos/Abhinav_Demos/nthroot1.sci new file mode 100644 index 00000000..201338b3 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/scalar.sci b/2.3-1/demos/Abhinav_Demos/scalar.sci new file mode 100644 index 00000000..6b280eaa --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/square.sci b/2.3-1/demos/Abhinav_Demos/square.sci new file mode 100644 index 00000000..172f73c4 --- /dev/null +++ b/2.3-1/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/2.3-1/demos/Abhinav_Demos/vector.sci b/2.3-1/demos/Abhinav_Demos/vector.sci new file mode 100644 index 00000000..dedd8f1a --- /dev/null +++ b/2.3-1/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 diff --git a/2.3-1/demos/Brijesh_Demos/Test_Erfcx.sci b/2.3-1/demos/Brijesh_Demos/Test_Erfcx.sci new file mode 100644 index 00000000..e17ae514 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/Test_Erfcx.sci @@ -0,0 +1,10 @@ +function Test_Erfcx + disp('Datatype: Double'); + i1 = [.75 .8 -.32]; + o1 = erfcx(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 .5; 7 .8 .9]); + o2 = erfc(i2); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/Test_Erfinv.sci b/2.3-1/demos/Brijesh_Demos/Test_Erfinv.sci new file mode 100644 index 00000000..99a8683a --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/Test_Erfinv.sci @@ -0,0 +1,10 @@ +function Test_Erfinv + disp('Datatype: Double'); + i1 = [12 0.6 -2 -0.75]; + o1 = erfinv(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([5 0.35 -1 -.97 -6]); + o2 = erf(i2); + disp(o2); +endfunction diff --git a/2.3-1/demos/RPi/RPi.dem.gateway.sce b/2.3-1/demos/RPi/RPi.dem.gateway.sce index 29d4c710..c125e9c7 100644 --- a/2.3-1/demos/RPi/RPi.dem.gateway.sce +++ b/2.3-1/demos/RPi/RPi.dem.gateway.sce @@ -11,6 +11,7 @@ subdemolist = ["Wait and Blink","test_wait_and_blink.dem.sce"; + "LCD","test_lcd.dem.sce" ]; global SCI2CHOME; diff --git a/2.3-1/demos/RPi/test_lcd.dem.sce b/2.3-1/demos/RPi/test_lcd.dem.sce new file mode 100644 index 00000000..2bd19516 --- /dev/null +++ b/2.3-1/demos/RPi/test_lcd.dem.sce @@ -0,0 +1,19 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME + "/tests/unit_tests/test_RPi/lcd.sci", TMPDIR,SCI2CHOME + "/tests/unit_tests/test_RPi/", "All", "make" ,"RPi", "uno"); + +editor([TMPDIR+"/main.c"]); diff --git a/2.3-1/demos/scilab2c.dem.gateway.sce b/2.3-1/demos/scilab2c.dem.gateway.sce index 7e987879..1e2a6c7f 100644 --- a/2.3-1/demos/scilab2c.dem.gateway.sce +++ b/2.3-1/demos/scilab2c.dem.gateway.sce @@ -22,7 +22,7 @@ subdemolist =["Linear Algebra","LinearAlgebra/LinearAlgebra.dem.gateway.sce"; "Symbols", "Symbols.dem.sce"; "Jacobi functions","Jacobi.dem.sce"; "String Functions","string.dem.sce"; - "Ffilt coeff. of FIR low pass filter","ffilt.dem.sce"; - "Design of FIR linear phase filters using freq. samping technique","fsfirlin.dem.sce"; - "Samples of sinc function","filt_sinc.dem.sce";] + "Ffilt coeff. of FIR low pass filter","ffilt.dem.sce"; + "Design of FIR linear phase filters using freq. samping technique","fsfirlin.dem.sce"; + "Samples of sinc function","filt_sinc.dem.sce";] subdemolist(:,2) = demopath + subdemolist(:,2); |