How to write variables values on a figure?

19 ビュー (過去 30 日間)
Jucimar Carpe
Jucimar Carpe 2018 年 11 月 27 日
編集済み: KALYAN ACHARJYA 2018 年 11 月 27 日
Hi, in my script i would like to write some variables values on a figure that i call it from a pushbutton Gui oriented. How can i call the figure in the right way and writting on it in a specific position of my picture.
PS: Notice i won't have axis to be oriented, but i don't know if this will be a problem or not.
Thanks in advance!

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 11 月 27 日
編集済み: KALYAN ACHARJYA 2018 年 11 月 27 日
This is an example
t=1:.01:10;
d=1; % here d is variable
dim=[0.5, 0.2, 0.1, 0.1]; %From here you can location the position of text
plot(sin(t));
str=sprintf('%.2f',d); %if No floting varibale number, use %d
annotation('textbox',dim,'String',str,'FitBoxToText','on');
99.png
For detail, check here
  4 件のコメント
Jucimar Carpe
Jucimar Carpe 2018 年 11 月 27 日
Hey Kalyan, thank you very much! works perfectly!!!
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 11 月 27 日
編集済み: KALYAN ACHARJYA 2018 年 11 月 27 日
Welcome @Jucimar
I am glad, it helped.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by