Download - Matlab vs. Scilab
![Page 1: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/1.jpg)
Matlab vs. Scilab
Rafael Brunner
![Page 2: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/2.jpg)
What‘s going on?• Few words about Scilab‘s origin• Introduction to Scilab:
- linear algebra- programming
• Parts of my term work:- sparse matrices- Savitzky-Golay filter- performance comparison
• My own experiences
![Page 3: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/3.jpg)
Scilab• developed since 1990 at INRIA /
ENPC (France)• open source• free of charge• high quality toolboxes available
- artificial network- serial port
• similar to Matlab... yes, but...
![Page 4: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/4.jpg)
Demo• Linear Algebra
- basics (how to enter matrices etc.)- compute with matrices- solving systems of equations- hessenberg form- LU-, QR-decomposition- eigenvalues, -vectors- SVD
![Page 5: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/5.jpg)
Programming• introduction / overview• example: poisson2d_kron
![Page 6: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/6.jpg)
Overview (1)• for var = expr, statement; ...;
statement; end• while expression, statements; end• if expr then statements;
elseif expr then statements;else statements;end
![Page 7: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/7.jpg)
Overview (2)• select expr
case expr1 then instructions1 ... case exprn then instructionsn [else instructions]end
![Page 8: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/8.jpg)
Overview (3)• [lhs,rhs] = argn(0)• error• warning
![Page 9: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/9.jpg)
Example (demo)• poisson2d_kron.m poisson2d_kron.sci• mfile2sci
![Page 10: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/10.jpg)
2D-Poisson matrix
![Page 11: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/11.jpg)
Sparse matrices• Three different algorithms to
generate the 2D-Poisson matrix:- set the elements one by one- block wise- kronecker product
![Page 12: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/12.jpg)
Performance comparison
![Page 13: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/13.jpg)
Solving a system Ax=b• in this case Ax = 1• pcg (preconditioned conjugate
gradients method)• Scilab does not provide a pcg
method Scilin (IRISA)
![Page 14: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/14.jpg)
Demo• Solving Ax=1 for n=100• 2D-Poisson matrix generated by
poisson2d_kron
![Page 15: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/15.jpg)
Performance comparison
![Page 16: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/16.jpg)
Savitzky-Golay Filter• measured data (slowly varying and
corrupted by random noise)• reconstruction of the underlying
smooth function
![Page 17: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/17.jpg)
Savitzky-Golay Filter (DEMO)
![Page 18: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/18.jpg)
My own experiences• editor• translating
- build up new functions- mfile2sci
![Page 19: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/19.jpg)
Summary• speed• graphics• signal processing
![Page 20: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/20.jpg)
Is Scilab an alternative to Matlab?
![Page 21: Matlab vs. Scilab](https://reader030.vdocuments.us/reader030/viewer/2022021420/586a41e51a28ab2a738b8b62/html5/thumbnails/21.jpg)
In my opinion:Scilab is capable and can be
an alternative to Matlab.