Get rid of unnecessary space in output of full(A)
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Bo Bramer
il 2 Dic 2020
Commentato: Bo Bramer
il 2 Dic 2020
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?
0 Commenti
Risposta accettata
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)
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!