Format display number into table

I trieded to change the format of my display number by ussing "format".
All my information are Wh
I have the exemple which displays
2.137873250705810e+04
ans = 2.1379e+04
It should display
21379
ans = 21379
I don't want to use an fprint because I want to work directly in my table

5 comentarios

Stephen23
Stephen23 el 4 de Jul. de 2023
Editada: Stephen23 el 4 de Jul. de 2023
Where exactly are you viewing/displaying this table? In the command window, or in the variable viewer, or in a UI table of some kind, or using the report generator, or publishing tools, or exporting to a file of some kind?
Is this an actual table class, or just a numeric array or cell array?
Rik
Rik el 4 de Jul. de 2023
Do you mean directly in the variable editor? Because I'm not aware of any documented way to control that format. In this case rounding the numbers would probably do it, but that changes the underlying data.
Greg LANGE
Greg LANGE el 4 de Jul. de 2023
@Stephen23 i have changed my question with a screen shot.
I use a object class "table" to store multi info after running my script like a sort of " balance sheet"
Stephen23
Stephen23 el 4 de Jul. de 2023
"I use a object class "table" to store multi info after running my script like a sort of " balance sheet""
Your screenshot shows a double class array.
Yes correct, my bad .

Iniciar sesión para comentar.

 Respuesta aceptada

Stephen23
Stephen23 el 4 de Jul. de 2023
Editada: Stephen23 el 4 de Jul. de 2023

0 votos

You can change the variable viewer format in the options:
Preferences -> Variables -> Format -> Default Display Format.
You need to close and reopen the variable viewer for this to take effect.

3 comentarios

Greg LANGE
Greg LANGE el 4 de Jul. de 2023
Indirectly, i already tried to use your instruction by using " format"
Stephen23
Stephen23 el 4 de Jul. de 2023
The FORMAT command only affects the command window. It has no effect on the variable viewer.
Greg LANGE
Greg LANGE el 4 de Jul. de 2023
I have chosen format bank or short e

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2021a

Preguntada:

el 4 de Jul. de 2023

Comentada:

el 4 de Jul. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by