0% found this document useful (0 votes)
39 views2 pages

Matlab

You can selectively save individual variables from the MATLAB workspace using the save command, specifying the variables to save. Plotting functions allow specifying line style, marker symbols, and color in the function call to customize the generated plot. Line style options include solid, dashed, dotted, and dash-dot lines. Marker symbol options include points, circles, squares, and various triangles. Color can be specified as well using color names like red, green, blue.

Uploaded by

Bruce Lim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

Matlab

You can selectively save individual variables from the MATLAB workspace using the save command, specifying the variables to save. Plotting functions allow specifying line style, marker symbols, and color in the function call to customize the generated plot. Line style options include solid, dashed, dotted, and dash-dot lines. Marker symbol options include points, circles, squares, and various triangles. Color can be specified as well using color names like red, green, blue.

Uploaded by

Bruce Lim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

You can save and load MAT-files programmatically using the save and load commands.

>> save
Creates myData.mat containing current workspace variables. myData

Instead of saving the entire MATLAB workspace, you can selectively save >> save
someFile x y
individual variables. Saves x and y to someFile.mat.

>> load
Loads variables from myData.mat into current workspace. myData

Description
Plotting functions accept line specifications as arguments and modify the graph generated
accordingly. You can specify these three components:
 Line style
 Marker symbol
 Color
For example:
plot(x,y,'-.or')
plots y versus x using a dash-dot line (-.), places circular markers (o) at the data points, and colors
both line and marker red (r). Specify the components (in any order) as a character vector after the
data arguments. Note that linespecs are not name-value pairs.

Plotting Data Points with No Line


If you specify a marker, but not a line style, only the markers are plotted. For example:
plot(x,y,'d')

Line Style Specifiers


You indicate the line styles, marker types, and colors you want to display, detailed in the following
tables:

Specifier LineStyle
'-' Solid line (default)
'--' Dashed line
':' Dotted line
'-.' Dash-dot line
Marker Specifiers
Specifier Marker Type
'+' Plus sign
'o' Circle
'*' Asterisk
'.' Point
'x' Cross
Specifier Marker Type
'square' or 's' Square
'diamond' or 'd' Diamond
'^' Upward-pointing triangle
'v' Downward-pointing triangle
'>' Right-pointing triangle
'<' Left-pointing triangle
'pentagram' or 'p' Five-pointed star (pentagram)
'hexagram' or 'h' Six-pointed star (hexagram)
Color Specifiers
Specifier Color
r Red
g Green
b Blue
c Cyan
m Magenta
y Yellow
k Black
w White

You might also like