COMP
lecture_10

# lecture_10 - Lecture 10 Comp 116 Feb 8th 2009 Objectives...

• Notes
• 16

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

Click to edit Master subtitle style 10/6/09 Lecture 10 Comp 116 Feb 8th, 2009

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

10/6/09 Objectives Plotting 2D plots – line, bar, pie changing properties
10/6/09 Plotting

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

10/6/09 Plotting plot(x, y) plot(x1, y1, x2, y2, x3, y3) plot(x, M) M has data stored in rows
10/6/09 Overlaid plots Multiple lines plot(x1, y1); hold on; plot(x2, y2); hold off;

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

10/6/09 Styles Plot style plot(x, y, 'r.-') Color, Marker, Line
10/6/09 Properties Plot properties plot(x, sin(x), 'bo-', 'LineWidth', 2, 'MarkerEdgeColor', 'k', ...'MarkerFaceColor', [0.49, 1.00, 0.63], 'MarkerSize', 12); Plot(x, y, ‘ prop1 ’, value1, ‘ prop2 ’, value2, …);

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

10/6/09 Plot: colors Colors in MATLAB All colors are specified by how much red, green and blue are in it. [0 0 0] % black [0.5 0.5 0.5] % gray [1 1 1] % white [1 1 0] % yellow [1 0 0] % red [1 0 1] % magenta [0 1 0] % green [0 1 1] % cyan [0 0 1] % blue [95 177 225]/255 % Carolina Blue
10/6/09 Plot: colors plot(x, y, ‘ color ’, [1 0 0]); Specifies a single color for all the columns of x and y Examples: x = 2 * pi * [0:0.01:1]’; y = sin(x); plot(x, y, ‘ color ’, [1 0 1]); plot(x, [y 2*y 3*y], ‘ color ’, [1 0 1]);

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• Stotts
• C Programming, different colors, Carolina Blue, 255 %

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern