OnePiece0039
OnePiece0039

Reputation: 1

How can i change the format of an array in matlab

I want A to simply ouput: 1 2 3 when i type A in command window.

instead of:

  Columns 1 through 3 
  1 2 3

because it's giving me a problem when i used huffmanenco function.

Upvotes: 0

Views: 83

Answers (2)

il_raffa
il_raffa

Reputation: 5190

If it is only matter of diplaying the content of the array, you might use:

num2str(A)

or

sprintf('%d ',A)

or

sprintf('%f ',A)

Hope this helps.

Upvotes: 1

Brethlosze
Brethlosze

Reputation: 1618

Check the Preferences>Numeric Display>Compact.

If you are using classes, you can override the display(s) function operator...

Upvotes: 0

Related Questions