MATLAB Answers

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

17 views (last 30 days)
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?


Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Dec 2020
You can add a format specifier to num2str() to be more specific about widths.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by