fprintf
28 ビュー (過去 30 日間)
古いコメントを表示
I'm having a bit of trouble with my fprintf
example :
x = 35
y = column of words
fprintf('%g blah blah blah %s',x,y{:})
fprintf then displays
35 blah blah word1
66 blah blah word2
.
.
.
.
how do i make it so it display
35 blah blah
list of words
3 件のコメント
Fangjun Jiang
2011 年 11 月 1 日
You have more data than the '%g' and '%s' specified so '%g' and '%s' will be used repeatedly. Apparently, '%g' won't be the right format for strings.
fprintf('%g blah blah\n',x);
fprintf('%s\n',y{:});
採用された回答
その他の回答 (1 件)
Jan
2011 年 11 月 1 日
You need 2 FPRINTF commands:
fprintf('%g blah blah blah\n', x);
fprintf('%s\n', y{:});
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Trigonometry についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!