- Using the "char" function which works for all special characters:\n"Hello" + char(13) + char(10)
- Using a MATLAB string:\n"Hello" + newline
- Using a traditional character vector:\n['hello' newline]
How can I specify special characters in a String Constant block?
21 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2022 年 9 月 2 日
編集済み: MathWorks Support Team
2022 年 9 月 13 日
How can I specify special characters such as CR (carriage return, "\r" or ASCII 13) and LF (line feed, "\n" or ASCII 10) in a String Constant block in Simulink?
"\" does not seem to work as an escape character with the String Constant block.
採用された回答
MathWorks Support Team
2022 年 9 月 13 日
編集済み: MathWorks Support Team
2022 年 9 月 13 日
The String Constant block takes any MATLAB expression that represents a string. For special characters like line feed, users just follow what they do exactly in MATLAB.
Here are some examples:
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!