フィルターのクリア

format numbers in plot

8 ビュー (過去 30 日間)
Haris Hameed
Haris Hameed 2012 年 4 月 25 日
hi
i am using text command to show variable value in plot
but i am not able to format this variable (format short)
text(5,3,['variable value=',char(a)]) i get variable value = 0.324546494654894846156486494646
so how to format it to 0.32454

採用された回答

Daniel Shub
Daniel Shub 2012 年 4 月 25 日
instead of your char(a)
I would use
num2str(double(a), 6)
or
sprintf('%0.6f', double(a))
  3 件のコメント
Daniel Shub
Daniel Shub 2012 年 4 月 25 日
See my edit. I missed your "a" was a sym. You need to convert the sym to a double first.
Haris Hameed
Haris Hameed 2012 年 4 月 25 日
thankx it works

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by