List functions on fprintf

2 ビュー (過去 30 日間)
Abra dog
Abra dog 2011 年 10 月 31 日
How do you list something on fprintf? I want them in a column than kyou
  2 件のコメント
Jan
Jan 2011 年 10 月 31 日
And what do you want to appear in this list? Have you read "help fprintf" already?
Abra dog
Abra dog 2011 年 10 月 31 日
I have read fprintf but i'm still a little bit confused about it.
I want it to display two columns the first is numbers and the second is a string

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

採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 31 日
fprintf('%10.2f\n', YourMatrix)
  3 件のコメント
Walter Roberson
Walter Roberson 2011 年 10 月 31 日
If you need to display a mix of numbers and strings on a single line, then you need to loop over each line. For example:
for K = 1:length(YourMatrix)
fprintf('%10.2f %s\n', YourMatrix(K), YourStrings(K,:));
end
Abra dog
Abra dog 2011 年 11 月 1 日
One more question when i tried your way for some reason it would repeat what i typed for my whole matrix did I do something wrong?

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

その他の回答 (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