问题描述
编程subplot(n,m,i)句柄的时候,title无法插入
syms t;
xt = sin(3*t);
yt = cos(3*t);
fplot(xt);
title('sin');
xlabel('x');
ylabel('y');
subplot(2,1,1);
fplot(yt);
title('cos');
xlabel('x');
ylabel('y');
subplot(2,1,2);
原因分析:
大概是每次subplot语句会刷新图像,导致title消失
解决方案:
只需要把每一个subplot提前到title语句之前
syms t;
xt = sin(3*t);
yt = cos(3*t);
subplot(2,1,1);
fplot(xt);
title('sin');
xlabel('x');
ylabel('y');
subplot(2,1,2);
fplot(yt);
title('cos');
xlabel('x');
ylabel('y');