# Lab5 - plot(a,b Exercise 4 c=linspace(0,5,51 d=c.^3-9*c.^2...

This preview shows pages 1–3. Sign up to view the full content.

Exercise 1 x=[0 2 3 4 6 8] y=[2 5 7 17 7 0] plot(x,y) Exercise 2 v=[2 3 4 -2 6] w=[5 12 8 6 7] v*w ??? Error using ==> mtimes Inner matrix dimensions must agree. The vectors cannot be multiplied because they are of different dimesions. v.*w [10 36 32 -12 42] The individual entries in the vectors multiply each other. v.^3 [8 27 64 -8 216] The matrix v was taken to the third power. v./w [0.4000 0.2500 0.5000 -0.3333 0.8571] The matrix v was divided by w. Exercise 3 a=[0 1 2 3 4 5] b=a.^3-9*a.^2+18*a

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: plot(a,b) Exercise 4 c=linspace(0,5,51) d=c.^3-9*c.^2+18*c plot(c,d) Exercise 5 r=linspace(-2,6,41) s=r.^3-5*r.^2-4*r+20 plot(r,s) Exercise 6 There are 21 entries in ‘cat’ spaced by ¼. There are 7 entries in ‘rat’ spaced by 3. Exercise 7 d=[0 2 4 5 6 8] f=[0 20 30 50 70 100] Use a ‘m’ for mauve and ‘x’ for x. Exercise 8 plot(d,f,'b:p') xlabel('Dog Years') ylabel('Human years') title('The passage of time')...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

Lab5 - plot(a,b Exercise 4 c=linspace(0,5,51 d=c.^3-9*c.^2...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online