Display the final value of a variable of a plot in figure window

58 ビュー (過去 30 日間)
Dhruba jyoti Bora
Dhruba jyoti Bora 2020 年 9 月 1 日
コメント済み: Dhruba jyoti Bora 2020 年 9 月 1 日
In the following plot, I need to display only the final value of "a" for each individual plots (marked by black circles). All other values are not required to display. And the position of values in the plot should be at suitable positions (not overlap the values of the side plots). Please help
a=17.63*3.6;
i=0:0.5:18
a=a*i;
plot(i,a,'linewidth',1);
hold on;
hold on;
a=34.32*3.6;
i=0:0.5:9
a=a*i;
plot(i,a,'linewidth',1);
hold on;
a=67.69*3.6;
i=0:0.5:4.5
a=a*i;
plot(i,a,'linewidth',1);
hold on;
a=84.38*3.6;
i=0:3
a=a*i;
plot(i,a,'linewidth',1);
hold on;
a=167.81*3.6;
i=0:0.5:1.5
a=a*i;
plot(i,a,'linewidth',1);
hold on;
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2020 年 9 月 1 日
text(i(end)+offset_x,a(end)+offset,num2str(a(end)))
Dhruba jyoti Bora
Dhruba jyoti Bora 2020 年 9 月 1 日
Thanks a lot. It worked

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

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 9 月 1 日
something like this
%%
a=17.63*3.6;
i=0:0.5:18
a=a*i;
plot(i,a,'linewidth',1);
hold on;
%%
offset=10;
text(i(end),a(end)+offset,num2str(a(end)))

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by