Lecture 05 Presentation

Lecture 05 Presentation - 14:440:127 Introduction to...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
14:440:127 Introduction to Computers for Engineers Lecture 5 LEASE TAKE LECTURE 5 NOTES PLEASE TAKE LECTURE 5 NOTES AS YOU ENTER THE ROOM! Lecturer: Blase E. Ur Recitation Instructor: Bo Jin Recitation Instructor: Cyrus Gerami Recitation Instructor: Vishnu Vijayakumar Recitation Instructor: Wen Yueh
Background image of page 1

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

View Full DocumentRight Arrow Icon
14:440:127 Lecture 5 2-D Plot Arguments: Vector of x points, Vector of y points xpoints = [ 1 2 3 4 5 ]; ypoints = [ 6 8 9 12 15 ]; plot(xpoints, ypoints) Rutgers University SOE
Background image of page 2
14:440:127 Lecture 5 Use linspace or colon to create x xpoints = linspace(0,20,100); ypoints = xpoints.^3; plot(xpoints, ypoints) Rutgers University SOE
Background image of page 3

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

View Full DocumentRight Arrow Icon
14:440:127 Lecture 5 Function Plots fplot('sin(x)',[-2*pi,2*pi]) ‘sin(x)’ is in quotes [-2*pi,2*pi] = interval for x Rutgers University SOE
Background image of page 4
14:440:127 Lecture 5 Adding Titles and Labels for Axes x = linspace(0,20,100); y = x.^3; plot(x, y) title('X Cubed') xlabel('X Points') Rutgers University SOE ylabel('Y Points') grid on
Background image of page 5

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

View Full DocumentRight Arrow Icon
14:440:127 Lecture 5 Changing C o l o r s x = 1:5; y = [6 8 9 12 15]; plot(x, y,'--dg') Rutgers University SOE
Background image of page 6
14:440:127 Lecture 5 Multiple Windows figure(1) plot(xpoints, ypoints) figure(2) plot(x,y) figure(1) % go back and overwrite the first figure Rutgers University SOE plot(x,y)
Background image of page 7

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

View Full DocumentRight Arrow Icon
14:440:127 Lecture 5 Multiple Graphs in One Figure- Method 1 x1 = 1:0.1:10; x2 = 1.5:0.1:10; y1 = 3*x1.^2; y2 = 3.5*x2.^(1.5); plot(x1,y1,x2,y2) Rutgers University SOE legend('first line', 'second line')
Background image of page 8
14:440:127 Lecture 5 Multiple Graphs in One Figure- Method 2 x1 = 1:0.1:10; x2 = 1.5:0.1:10; y1 = 3*x1.^2; y2 = 3.5*x2.^(1.5); plot(x1,y1) Rutgers University SOE hold on; plot(x2,y2) hold off; Unfortunately, this method makes it difficult to make a legend
Background image of page 9

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

View Full DocumentRight Arrow Icon
14:440:127 Lecture 5 Subplot Graph 1 Graph 2 Graph 3 Graph 4 Graph 5 Graph 6 Rutgers University SOE subplot(rows, columns, #) subplot(2,2,1); plot(x,y) subplot(2,2,2)…
Background image of page 10
14:440:127 Lecture 5 Subplot x = linspace(0,10,100); y1 = x;
Background image of page 11

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

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 37

Lecture 05 Presentation - 14:440:127 Introduction to...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online