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 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