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?

 Respuesta aceptada

Star Strider
Star Strider el 28 de Ag. de 2016
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.

Más respuestas (1)

Andy Hutchinson
Andy Hutchinson el 28 de Ag. de 2016

0 votos

Cheers mate.

Categorías

Etiquetas

Preguntada:

el 28 de Ag. de 2016

Comentada:

el 28 de Ag. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by