AllFreePapers.com - All Free Papers and Essays for All Students
Search

Matlab Codes and Graphs

Autor:   •  April 11, 2016  •  Lab Report  •  1,284 Words (6 Pages)  •  722 Views

Page 1 of 6

1) Investigate th effect of the following matlab commands:

v= [2 4 7 5];

                                                             

w=[1 3 8 9];

(a)  v(2)

ans =

     4

(b) sum=v+w

sum =

     3     7    15    14

(c) diff=v-w

diff =

     1     1    -1    -4

(d) vw=[v w]

vw =

     2     4     7     5     1     3     8     9

(e) vw(2:6)

ans =

     4     7     5     1     3

(f)  v'

ans =

     2

     4

     7

     5

2) Investigate th effect of the following commands:

 (a) z=[1;1;0;0];

 z'

ans =

     1     1     0     0

(b) z*v

ans =

     2     4     7     5

     2     4     7     5

     0     0     0     0

     0     0     0     0

(c)  [v;w]

ans =

     2     4     7     5

     1     3     8     9

(d) v*z

ans =

     6

(e) [z;v']

ans =

     1

     1

     0

     0

     2

     4

     7

     5

(f) z+v'

ans =

     3

     5

     7

     5

3) Investigate th effect of the following commands:

M=[1 2;3 4];

(a) N=inv(M)

N =

   -2.0000    1.0000

    1.5000   -0.5000

(b) M*N

ans =

    1.0000         0

    0.0000    1.0000

(c) I=eye(2)

I =

     1     0

     0     1

(d) M + I

...

Download as:   txt (3.8 Kb)   pdf (215.4 Kb)   docx (51.5 Kb)  
Continue for 5 more pages »