Differences between revisions 1 and 2
Revision 1 as of 2025-10-22 17:49:52
Size: 845
Comment: Initial commit
Revision 2 as of 2026-01-05 17:09:11
Size: 864
Comment: Add format
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
 * `rat` (ratios)

MATLAB Display Format

The display format is controlled by the format command/function.


Usage

The number of displayed decimal places is controlled by the display format.

To change the style to s, try either format s or format("s"). Note that quotes are required by the second form.

Built-in styles include:

  • short (4 decimal places)

  • long (15 decimal places)

  • hex

  • rat (ratios)

To access and store the current style, use fmt = format. To do that and set the style to s, try fmt = format("s").

Maximum Values

To access the maximum values of data types, try:

>> format hex
>> intmax('uint64')

ans = uint64
   ffffffffffffffff

>>> realmax

ans = uint64
   7fefffffffffffff


CategoryRicottone

MATLAB/DisplayFormat (last edited 2026-01-05 17:09:11 by DominicRicottone)