Get rid of unnecessary space in output of full(A)

3 visualizzazioni (ultimi 30 giorni)
How do I get rid of the unecessary space while also not using scientific notation? When using
format short
full(A) % A is a 14x14 matrix
it displays compact like I'd like it to, but is in scientific notation, making it more difficult to read:
But, when I change it to
format shortG
it stops using scientific notation as the numbers are all less than 5 digits long, but it then displays it with a significant amount of unnecessary space:
How do I make it such that the matrix displays in non-scientific notation, like in the second image, but in a compact format, like in the first image?

Risposta accettata

Walter Roberson
Walter Roberson il 2 Dic 2020
disp(num2str(full(A)))
You can add a format specifier to num2str() to be more specific about widths.

Più risposte (0)

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by