Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Experiment-3

AimWrite a MATLAB program to define the vectors u=[1 2 3 4] and v=[2 3 4 5].Now determine the following using MATLAB-: (a) Multiply vector v with a scalar quantity 5. (b)Take the power of 5 of a vector u. (c)Take the power of 5 of a vector v. (d)Multiply the vectors element by element. (e)First take the transpose of a vector v and then multiply the vector u and v.

Codeu=[1 2 3 4] v=[2 3 4 5] a=v*5 b=u.^5 c=v.^5 d=u.*v e=v' f=u*v'

Outputu=

v=

a=

10 15 20 25

b=

32

243

1024

c=

32

243

1024

3125

d=

6 12 20

e=

2 3 4 5

f=

40

You might also like