Lecture 05 Presentation

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

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

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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
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)

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

View Full Document
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')
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

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

View Full Document
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)…
14:440:127 Lecture 5 Subplot x = linspace(0,10,100); y1 = x;

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.

## 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
Ask a homework question - tutors are online