Reference: http://blog.sina.com.cn/s/blog_61c0518f0100f0lg.html
1 Verify that the plot function is a fitted function.
>> y = (x >=0)*1; >> plot(x, y) >> plot(x, y)
Effect:
2 plot(x) When x is a vector, draw a curve with the value of the x element as the ordinate and the serial number of x as the abscissa . When x is a real matrix, its serial number is the abscissa, and the
curve .
When x is an m×n matrix, there are n curves.
>> x = [1 2 3; 1 2 3; 1 2 3; 1 2 3]
3 plot(x,y1,x,y2,…) draws multiple curves with common x elements as abscissa values and y1,y2,… elements as ordinate values.
4
The linetype properties available in MATLAB are:
line type |
illustrate |
marker |
illustrate |
colour |
illustrate |
- |
solid line (default) |
+ |
plus sign |
r |
Red |
-- |
double dash |
O |
hollow circle |
g |
green |
: |
dotted line |
* |
Asterisk |
b |
blue |
:. |
Dotted line |
. |
filled circle |
c |
green |
|
|
x |
cross sign |
m |
magenta |
|
|
s |
square |
and |
yellow |
|
|
d |
diamond |
k |
black |
|
|
^ |
upper triangle |
w |
White |
|
|
v |
lower triangle |
|
|
|
|
> |
right triangle |
|
|
|
|
< |
left triangle |
|
|
|
|
p |
Pentagram |
|
|
|
|
h |
hexagon |
|
|
>> plot(x, y, '--') >> plot(x, y, '--r') >> plot(x, y, '--hr')