Matlab作图备忘
figure(1);%图1
subplot(1,3,1);%子图1
x = linspace(0,10,11);%x
p_res = linspace(0,10,11);%p_res
plot(x,p_res);%作图
xlabel("x");ylabel("p");%标签
uoutlet = 15;%出口速度用于标注
uoutlet_str = num2str(uoutlet);%数字转字符串
legendline = strcat('outlet u = ',32,uoutlet_str);%这里利用ASCII码32表示空格
legend(legendline);%标注
subplot(1,3,2);%子图2
Ma_res = linspace(0,10,11);%Ma_res
plot(x,Ma_res);
xlabel("x");ylabel("Ma");
legend(legendline);
subplot(1,3,3);%子图3
e_num = linspace(0,10,11);
e_num = e_num(1,2:end);
e_num = log10(e_num);
plot(e_num);
xlabel("iteration times");ylabel("log10(error)");
legend(legendline);