How to put a value in a plot label?
39 ビュー (過去 30 日間)
古いコメントを表示
I have a surf plot where one fixed variable changes and each one is apart of a subplot. I would like the title of each subplot to reflect the fixed variable at that instance. My code currently is:
for k = 1:4
kd = 0.0143.*5*k;
SOTE = (a + kd + kp).*X.^beta.*5*k;
figure(1)
if k < 3
subplot(4,1,k)
surf(X, Y, SOTE)
title('Depth = (varying number here) ft');
xlabel('Flux (scfm)');
ylabel('AT/AD');
zlabel('SOTE (%)');
grid on
else
subplot(4,2,k)
surf(X, Y, SOTE)
title('Depth = (varying number here) ft');
xlabel('Flux (scfm)');
ylabel('AT/AD');
zlabel('SOTE (%)');
grid on
end
end
In each subplot the depth is 5, 10, 15, 20 respectively.
0 件のコメント
採用された回答
Alex Mcaulley
2019 年 10 月 29 日
depth = [5,10,15,20];
for k = 1:4
kd = 0.0143.*5*k;
SOTE = (a + kd + kp).*X.^beta.*5*k;
figure(1)
if k < 3
subplot(4,1,k)
surf(X, Y, SOTE)
title(['Depth = ' num2str(depth(i)) ' ft']);
xlabel('Flux (scfm)');
ylabel('AT/AD');
zlabel('SOTE (%)');
grid on
else
subplot(4,2,k)
surf(X, Y, SOTE)
title(['Depth = ' num2str(depth(i)) ' ft']);
xlabel('Flux (scfm)');
ylabel('AT/AD');
zlabel('SOTE (%)');
grid on
end
end
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!