Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic command Vectors and matrices in Scilab Data types: (real or complex) numbers, vectors, matrices, polynomials, strings, functions, … –Vectors in Scilab:

Similar presentations


Presentation on theme: "Basic command Vectors and matrices in Scilab Data types: (real or complex) numbers, vectors, matrices, polynomials, strings, functions, … –Vectors in Scilab:"— Presentation transcript:

1 Basic command Vectors and matrices in Scilab Data types: (real or complex) numbers, vectors, matrices, polynomials, strings, functions, … –Vectors in Scilab: –> x = [0 1 2 – 3] –> y = [2; 4; 6; 8] –> z = [1 2 3 4] ’ ’ is conjugate transpose of a matrix –> 3*x, y+z, y–z –> x+y, x+1

2 Basic command Vectors and matrices in Scilab (2) Matrices in Scilab: > A = [0 1 0 1; 2 3 –4 0] > B = A ’ > A * y, x * B, A * B, B * A, (B*A)^2 Special matrices (and vectors): > ones(2,3), zeros(1,2), eye(3,3) > rand, rand(3,2) Empty vector or matrix: > a = [ ] Building matrix by blocks: > C = [A 2*A], x = [9 x 7], a = [a 1]

3 Basic command Vectors and matrices in Scilab (2) Results:

4 Basic command The colon “:” operator –> 1:10, 1:100, xx = 1:100; –Using “;” to suppress answer output –> sum(xx) –> 1:2:10, –3:3:11, 4:–1:1, 2:1:0, –> t = 0: 0.1: 2*%pi –> y = sin(t) – > plot(t,y), plot(t,sin(t),t,cos(t))

5 Basic command The colon “:” operator,Result

6 Basic command The colon “:” operator,plot (t,y) Result

7 Basic command The colon “:” operator plot(t,sin(t),t,cos(t)),Result

8 DSP Related command We can see all function related to Signal Processing using >>siglib

9 DSP example command DSP FunctionMatlab CommandScilab command Plot discrete sequence data Stemplot2d3 1-D digital filter Filterflts 2-D digital filter Filter2- Convolution and polynomial multiplication convconvol 2-D convolution Conv2- Initial conditions for transposed direct-form II filter implementation Filteric- Frequency response of digital filter Freqzfreq Discrete Fourier transform Fftfft Read Microsoft WAVE (.wav) sound file Wavereadwavread Shift zero-frequency component of discrete Fourier transform to center of spectrum fftshift

10 DSP example command(1) stem function can replace with plot2d3 plots2d3: 2D plot (vertical bars)


Download ppt "Basic command Vectors and matrices in Scilab Data types: (real or complex) numbers, vectors, matrices, polynomials, strings, functions, … –Vectors in Scilab:"

Similar presentations


Ads by Google