01PLOT函数使用
PLOT( )
Plot(x,y),横轴为x,纵轴为y。
Plot(y),横轴就为1,2,3,4....
PLOT()
Plot(x,y), the horizontal axis is x, and the vertical axis is y.
Plot(y), the horizontal axis is 1, 2, 3, 4....
执行两行命令时
When executing two lines of commands
可以看出只有第二行命令sin函数的图
You can see that only the second line of the command sin function
这是因为matlab绘图会自动将前面图形的命令删掉,这时要用hold on指令,就不会自动覆盖前面的图形
This is because matlab drawing will automatically delete the commands of the previous graphics. At this time, use the hold on command, and the previous graphics will not be automatically refreshed.
hold on命令执行后,呈现了两行命令的图形
After the hold on command is executed, two lines of commands are displayed
02图形特征的修改
PLOT(x,y,'str')
'str'可设置图形的标志、线条形状以及颜色。
PLOT(x,y,'str')
'str'