フィルターのクリア

Display long statements on multiple lines in output

25 ビュー (過去 30 日間)
Swasti Khuntia
Swasti Khuntia 2012 年 9 月 6 日
編集済み: Mohammed Musleh 2018 年 9 月 24 日
Hello All,
I want to include some texts in the description of a structure. But it#s too long to be displayed in a single line. I want that to be displayed in 2 or 3 lines.
Any suggestions on how to do it?
Thanks

採用された回答

José-Luis
José-Luis 2012 年 9 月 6 日
One way to go. Insert newline in your string, and display using fprintf:
yourString = 'One line \n Two line \n Three line';
fprintf(your_String);
  4 件のコメント
Swasti Khuntia
Swasti Khuntia 2012 年 9 月 6 日
Thanks a lot !!! It' perfect !!!
Mohammed Musleh
Mohammed Musleh 2018 年 9 月 23 日
編集済み: Mohammed Musleh 2018 年 9 月 24 日
Doing this in 2018, on version 2018a, Matlab is suggesting that I switch "char(10)" with just "newline" (outside of the single quotes). Works well.
But I prefer the compose function: https://www.mathworks.com/help/matlab/ref/compose.html

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

その他の回答 (0 件)

カテゴリ

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