Example 04
bar(x,y),barh(x,z),bar3(x,z),stairs(x,z),plot3(x,y,z)
GIVEN: Two sets of data (x,y) and (x,z)
REQUIRED: Plot the data with different formats.
SOLUTION: Generate example04.m
x=[0 1 2 3 4 5];
y=[6 7 8 9 10 11];
z=[12 14 16 18 20 22];
subplot(2,2,1),bar(x,y)
subplot(2,2,2),barh(x,z)
subplot(2,2,3),bar3(x,z)
subplot(2,2,4),stairs(x,z)
figure
plot3(x,y,z)
Example
Homework:
a. Do a stem plot!
b. Change the view point on plot3.
Please send questions or suggestions about this web page to beatnic@aset.psu.edu
ASET | ITS | Penn State
|