フィルターのクリア

How to adapt the number format for text in a graph

5 ビュー (過去 30 日間)
Frits
Frits 2011 年 4 月 14 日
LS,
I've added some text to a graph which consists of text and a value. In this case: "99% Lower Confidence Limit =" and then the value. Right now, the value is shown as 2738435 and I would like to make it 2.7 million or at least 2,738,435. How should I do that?
The code that I use is:
text(1,1,['99% Lower Confidence Limit =',num2str(value)]);
Thanks a lot in advance.
Best,
Frits Hermans

採用された回答

Robert Cumming
Robert Cumming 2011 年 4 月 14 日
or your could use:
text(1,1,sprintf('99%% Lower Confidence Limit =%3.2f Million',value/1e6));
  1 件のコメント
Jarrod Rivituso
Jarrod Rivituso 2011 年 4 月 14 日
ooo, I do like that

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

その他の回答 (1 件)

Jarrod Rivituso
Jarrod Rivituso 2011 年 4 月 14 日
You could try this if you want to take the comma route:
So then it would be
text(1,1,['99% Lower Confidence Limit =',ThousandSep(value)]);

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by