Example 03
subplot(2,1,1),plot(x,y,'+')
subplot(2,1,2),plot(x,z,'*')
GIVEN: Two sets of data (x,y) and (x,z)
REQUIRED: Plot the data on a subdivided window .
SOLUTION:Generate example03.m file:
File
New
Example03.m
Enter your data as follows:
x=[0 1 2 3 4 5];
y=[6 7 8 9 10 11];
z=[12 14 16 18 20 22];
subplot(2,1,1),plot(x,y,'+')
subplot(2,1,2),plot(x,z,'x')
Example
Homework:
a. Add a title to each figure
b. Turn the grid on for the lower figure
c. Add a legend to each figure
d. Choose more than two sub-figure
Please send questions or suggestions about this web page to beatnic@aset.psu.edu
ASET | ITS | Penn State
|