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 Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2016년 8월 28일

댓글:

2016년 8월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by