matlab recitation 4

# matlab recitation 4 - Practice Exercises 5.1...

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

Practice Exercises 5.1 x=[0:0.1*pi:2*pi] x = Columns 1 through 13 0 0.3142 0.6283 0.9425 1.2566 1.5708 1.8850 2.1991 2.5133 2.8274 3.1416 3.4558 3.7699 Columns 14 through 21 4.0841 4.3982 4.7124 5.0265 5.3407 5.6549 5.9690 6.2832 y=sin(x) y = Columns 1 through 13 0 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 0.5878 0.3090 0.0000 -0.3090 -0.5878 Columns 14 through 21 -0.8090 -0.9511 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 -0.0000 plot(x,y) grid on title('graph of sin(x)') xlabel('x') ylabel('y') y1=sin(x) y1 = Columns 1 through 13 0 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 0.5878 0.3090 0.0000 -0.3090 -0.5878

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

View Full Document
Columns 14 through 21 -0.8090 -0.9511 -1.0000 -0.9511 -0.8090 -0.5878 -0.3090 -0.0000 y2=cos(x) y2 = Columns 1 through 13 1.0000 0.9511 0.8090 0.5878 0.3090 0.0000 -0.3090 -0.5878 -0.8090 -0.9511 -1.0000 -0.9511 -0.8090 Columns 14 through 21 -0.5878 -0.3090 -0.0000 0.3090 0.5878 0.8090 0.9511 1.0000 plot(x,y1); plot(x,y2) plot(x,y1) plot(x,y2) title('graph of cosx') xlabel('x') ylabel('y') grid on plot(x,y1,'r--') grid on title('graph of sinx')
This is the end of the preview. Sign up to access the rest of the document.

### Page1 / 8

matlab recitation 4 - Practice Exercises 5.1...

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

View Full Document
Ask a homework question - tutors are online