How can I make the title of a plot the function I am plotting?
Here is the code trying to use:
x = 0:.01:1;
for i= 1:9
subplot(3,3,i)
y = x.^i;
plot(x, y, 'black')
xlabel('x')
ylabel('y')
% title()???
end

 채택된 답변

Bhaskar R
Bhaskar R 2020년 4월 8일

1 개 추천

x = 0:.01:1;
for i= 1:9
subplot(3,3,i)
y = x.^i;
plot(x, y, 'black')
xlabel('x')
ylabel('y')
title(['Title\_' sprintf('%d', i)])
end

댓글 수: 1

Thank you! I was able to display the exponential function as the title for each subplot using this. :)

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

추가 답변 (0개)

카테고리

제품

질문:

2020년 4월 8일

댓글:

2020년 4월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by