2-D Graphics

# 2-D Graphics - Chapter 26 2-D Graphics 26.1 The plot...

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

Chapter 26 2-D Graphics 26.1 The plot Function The basic function for producing 2-D graphs is the MATLAB ' plot ' function. It is generally called with two identically sized row (or column) vectors, one for the set of abscissa values and the second for the ordinate axis. The plotted points are ordered pairs of values, one from the first vector and one from the second vector. For example, to plot the points 1 1 2 2 ( , ), ( , ), . ...., ( , ) n n x y x y x y the arrays x= [ ] 1 2 , , ..... , n x x x and y= [ ] 1 2 , , ..... , n y y y are created and then passed to the plot function for graphing. Example 26.1.1 x=[0 2 5 8 10]; % Create x vector y=[0 4 -3 -3 6]; % Create y vector plot(x,y) % Plot (0,0), (2,4), (5,-3), (8,-3), (10,6) When the ' plot' command is issued within an m-File or from the Command window, MATLAB opens a new Figure window, draws a set of axes automatically scaled to fit the data, plots the points in the order in which they appear in the two vectors, and then connects all the points by straight lines. Numerical scales appear on both axes as do tick marks. The '

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.

## This note was uploaded on 06/09/2011 for the course EGM 4320 taught by Professor Klee during the Spring '11 term at University of Central Florida.

### Page1 / 3

2-D Graphics - Chapter 26 2-D Graphics 26.1 The plot...

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

View Full Document
Ask a homework question - tutors are online