Example 01
plot(x,y)
GIVEN: A set of x and y data.
REQUIRED: Plot the data and produce a hard copy.
SOLUTION: Method one: type in your data at the command line:
x=[0 1 2 3 4 5];
y=[6 7 8 9 10 11];
plot(x,y)
SOLUTION: Method two: generate a file with m extension and type in your commands:
File
New
Example01.m
Enter your data as follows:
x=[0 1 2 3 4 5];
y=[6 7 8 9 10 11];
plot(x,y)
Note:
A hard copy may be obtained by going to the pull down menu:
File
Print
Alternatively, you may save the figure as a postscript file.
Example
Homework:
a. Add a title
b. Label the x-axis
c. Label the y-axis
d. Turn the grid on
Please send questions or suggestions about this web page to beatnic@aset.psu.edu
ASET | ITS | Penn State
|