Create Plot Title of the Plotted Function

1 回表示 (過去 30 日間)
Forrest Graham
Forrest Graham 2020 年 4 月 8 日
コメント済み: Forrest Graham 2020 年 4 月 8 日
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 日
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 件のコメント
Forrest Graham
Forrest Graham 2020 年 4 月 8 日
Thank you! I was able to display the exponential function as the title for each subplot using this. :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by