User:Eml4500.f08.Lulz.Layton.Eric

Homework #1

MATLAB Primer 3rd Edition Examples:

-pg 17 Graphics Hardcopy

To obtain a hardcopy of the current graphic the command print is used. This command will send the image to the default printer using predefined settings. These settings can be changed by using the printopt command.

The command print followed by a name can be used to print and save the grapic. If the name following the print command does not include a post script the appropriate post script will be assigned to the file. Several graphics can be saved to a single file and printed using the print -append filename command. If the append command is not used on an existing file, the existing file will be overwritten with the new graphic.

Graphics other then the current graphic can be printed and saved by use of the command print -deps -graphic filename. An example of this command is print -deps -f4 Lulz. The previous command will save figure 4 in file Lulz.eps.

3-D Line Plots

Matlab will produce plots in 3 dimensions using the command plot3. If the X, Y and Z coordinates are the desired coordinates the the command would be as follows, plot3(X,Y,Z). An example of a plot using this command is as follows, t=.01:.01:20*pi; x=cos(t); y=sin(t); z=t.^3; plot3(x,y,z), which creates the following helix:

Lecture Outline: