Trying to display text and variable in a single output line. I was initially trying to use disp then a matrix then fprintf
1,061 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
その他の回答 (1 件)
Milly
2024 年 6 月 19 日
編集済み: Milly
2024 年 6 月 20 日
Not quite sure what issue the author had with the "disp" function but this should be the most efficient way to do this.
The given example would look like this:
var1 = 800;
disp("The answer is: " + var1 + " %")
The accepted answer using the disp function would look like this:
name = "Alice";
age = 12;
disp(name + " will be "+ age + " this year.")
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!