How to get a msgbox with several lines of texts showing different variables?
2 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
采纳的回答
Voss
2024-3-16
msg = sprintf('Total files processed: %d\nElapsed Time: %.2f', numel(S), toc);
l = msgbox(msg);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!