How to display all this in a single msgbox?

8 ビュー (過去 30 日間)
AbelM Kusemererwa
AbelM Kusemererwa 2015 年 7 月 9 日
コメント済み: Adam Danz 2018 年 8 月 10 日
fprintf('Percentage within bins for plan accuracy and height accuracy\n') fprintf('************************************************************\n')
fprintf(' Range Plan Accuracy Height Accuracy\n')
fprintf(' **********************************************************\n')
fprintf('\nLess than 5cm = %.2f %.2f \n', plan_pcent_less5,dH_pcent_less5)
fprintf('\nLess than 10cm = %.2f %.2f \n', plan_pcent_less10,dH_pcent_less10)
fprintf('\nLess than 15cm = %.2f %.2f \n', plan_pcent_less15,dH_pcent_less15)

採用された回答

Brendan Hamm
Brendan Hamm 2015 年 7 月 9 日
You can use sprintf to make these each into char arrays and place them into a cell array. Here's an example
x = 12;
msg = cell(3,1);
msg{1} = sprintf('abcdefg');
msg{2} = sprintf('hijklmnop')
msg{3} = sprintf('qrstuvwx%2.0f',x);
msgbox(msg)
  2 件のコメント
AbelM Kusemererwa
AbelM Kusemererwa 2015 年 7 月 9 日
編集済み: AbelM Kusemererwa 2015 年 7 月 10 日
Can the font size be change? Can it be presented in a table?
Adam Danz
Adam Danz 2018 年 8 月 10 日
編集済み: Adam Danz 2018 年 8 月 10 日

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

その他の回答 (1 件)

Jos (10584)
Jos (10584) 2015 年 7 月 9 日
To show multiple lines in a msgbox, use a cell array:
C{1} = 'Hello' ;
C{2} = sprintf('N = %d',10) ;
msgbox(C)
  3 件のコメント
Image Analyst
Image Analyst 2015 年 7 月 10 日
Sorry, no. Despite many of us asking for a long time, MATLAB still won't let us change the font size in msgbox(), helpdlg(), or warndlg(). You might try looking in undocumented MATLAB or else write your own GUI to take inputs for 'FontSize', 'FontWeight', 'Color', etc.
Adam Danz
Adam Danz 2018 年 8 月 10 日
Here's a function that will change msgbox fontsize

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by