About HPC Systems Software User Guides Education Partners

  / gears / hpc / education / tutorials / matlab / linux


Introduction

Definition

Example 01

Example 02

Example 03

Example 04

Example 05

Example 06

Example 07

Example 08

Example 09

Example 10

Example 11

Example 12

Example 13

Example 14

Example 15

Example 16

Example 17

Example 18

References

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