>> x=[0:0.5:10]
x =
Columns 1 through 7
0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000
Columns 8 through 14
3.5000 4.0000 4.5000 5.0000 5.5000 6.0000 6.5000
Columns 15 through 21
7.0000 7.5000 8.0000 8.5000 9.0000 9.5000 10.0000
>> y= 6*x+9
y =
Columns 1 through 12
9 12 15 18 21 24 27 30 33 36 39 42
Columns 13 through 21
45 48 51 54 57 60 63 66 69
>> z=4*cos(x) -5
z =
Columns 1 through 7
-1.0000 -1.4897 -2.8388 -4.7171 -6.6646 -8.2046 -8.9600
Columns 8 through 14
-8.7458 -7.6146 -5.8432 -3.8654 -2.1653 -1.1593 -1.0936
Columns 15 through 21
-1.9844 -3.6135 -5.5820 -7.4080 -8.6445 -8.9887 -8.3563
>> plot(x,y,x,z),xlabel('x'),gtext('y'),gtext('z')
单击鼠标按钮后,标记y和z
基本函数是
1.xlabel将单引号中的文本做为水平坐标轴上的标记
2.ylabel将单引号中的文本做为垂直坐标轴上的标记
3.gtext单击鼠标按钮一次,执行一次
4.grid在图形中放置网格线