I have a matrix size 380 by 24. However, it breaks it up! i.e it reads ''columns 19 through 24'' which is inconvenient for me. I can change this by using num2str but I don't want my data in strings. Any ideas?

 採用された回答

Star Strider
Star Strider 2016 年 8 月 28 日

0 投票

It only ‘breaks it up’ in the Command Window when you display it. The matrix itself is numeric, complete and intact in your workspace.
If you want to write it to the Command Window without breaking it between columns, use fprintf:
M = randi(99, 380, 24); % Your Matrix
fprintf(1, [repmat(' %9.5f', 1, 24) '\n'], M') % Command Line Display
Note that you have to transpose (') the matrix in the fprintf call.

その他の回答 (1 件)

Andy Hutchinson
Andy Hutchinson 2016 年 8 月 28 日

0 投票

Cheers mate.

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by