フィルターのクリア

How to get a msgbox with several lines of texts showing different variables?

2 ビュー (過去 30 日間)
Bradley
Bradley 2024 年 3 月 16 日
コメント済み: Voss 2024 年 3 月 16 日
Ive been working on a code and at the end I want a message box to pop up telling the user how many files were processed and how much time it took, ideally in the same message box. I want them on different lines but in the same box. Below is the code I wrote but I cant figure out how to make it work, ive tried several different formats. Thanks for any help in advance!
msg = sprintf(['Total files processed: %.0f', 1:numel(S); 'Elapsed Time: %.2f', toc]);
l = msgbox(msg);

採用された回答

Voss
Voss 2024 年 3 月 16 日
msg = sprintf('Total files processed: %d\nElapsed Time: %.2f', numel(S), toc);
l = msgbox(msg);
  2 件のコメント
Bradley
Bradley 2024 年 3 月 16 日
Awesome, Thanks!
Voss
Voss 2024 年 3 月 16 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by