例子:
t = [0:0.01:0.98]; //t 以0.01间隔 从0增加到0.98
plot(t,y1) //绘=绘制函数图像
hold on; //在之前绘制的图像的基础上绘制新的函数图像
y2= cos(8*pi*t);
plot(t,y2)
// 此时将上面两个函数在同一幅图中交叉画出来
用两个窗口来显示图像界面:
figure(1); plot(t,y1)
figure(2); plot(t,y2)
一个窗口分成多个区域来显示图像界面:
subplot(1,a,b)
表示将区域分成a 块 接下的图像将画在第 b 块
axis([0.5 1 -1 1])
将图像的横轴调到 0.5~1 将纵轴调到 -1~1
xlabel('time')
ylabel('value') 给横纵坐标加上名称 分别为 time value
legend('sin','cos') 标记这两条曲线 为 sin 和 cos
title('my plot') 给曲线上方加上标题print -dpng 'myplot.png' 保存画出的该图像在目录下
close 关闭图像界面
imagesc(A) 显示的图像中通过颜色的深浅来表示A中各个元素的值的大小
imagesc(A),colorbar,colormap gray; 逗号表示逗号连接的命令 顺序执行那几个命令