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.

 채택된 답변

Alex Mcaulley
Alex Mcaulley 2019년 10월 29일

0 개 추천

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

댓글 수: 1

A condensed version of the above code
depth = [5 10 15 20];
for k = 1:4
kd = (-0.001+0.0153)*depth(k);
SOTE = (a + kd + kp).*X.^beta*depth(k);
figure(1)
subplot(2,2,k)
surf(X, Y, SOTE)
title(['Depth is ',num2str(depth(k)),'ft']);
xlabel('Flux (scfm)');
ylabel('AT/AD');
zlabel('SOTE (%)');
grid on
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2019년 10월 29일

댓글:

2019년 10월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by