{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 10

# Lecture 10 - Lecture 10 Graphics in MATLAB BMEn 2401...

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

11/15/2010 1 Lecture 10: Graphics in MATLAB BMEn 2401 Programming for Biomedical Engineers Rich Beck November 16, 2010 1 2-D plots: plot command plot(x,y) is used to plot vector y versus vector x . Example: x = linspace(0,2*pi,100); y = sin (x); plot(x,y) 2

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

View Full Document
11/15/2010 2 2-D plots: plot command plot(x,y, 'line specifier') Example: x = linspace(0,2*pi,20) y = sin (x) plot(x,y,'o-.r') 3 Specifiers Line Specifiers: solid (default) - dashed -- dotted : dash-dot-. blue (default) b Color Specifiers: green g red r cyan c magenta m yellow y black k white w Marker Specifiers: asterisk * plus sign + circle o point . square s diamond d five-point star p cross x triangle (Up) ^ triangle (down) v triangle (left) < triangle (right) > six-point star h 4
11/15/2010 3 Other useful commands title ('S_t') adds the title 'S_t' to the graph. xlabel ('S_x') adds a label to x axis. ylabel ('S_y') adds a label to y axis. text (x0,y0, 'text string') add the string value at x0 and y0 on the graph. axis off removes the axis. axis on (default) brings the axis back. grid off (default) removes the grid lines. grid on adds major grid lines. 5 Example x = linspace(0,2*pi,20) y = sin (x) plot(x,y,'p:g') title('SIN(X) versus X') xlabel('X') ylabel('SIN(X)') text (pi+pi/6,0, ' At this point sin(x) is negative') 6 Note: This command should be in one line.

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

View Full Document
11/15/2010 4 fplot command fplot ('function', limits, 'line specifiers')
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 11

Lecture 10 - Lecture 10 Graphics in MATLAB BMEn 2401...

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

View Full Document
Ask a homework question - tutors are online