Short format display after using solve command

3 visualizaciones (últimos 30 días)
manish sharma
manish sharma el 10 de Ag. de 2012
Comentada: Walter Roberson el 29 de Sept. de 2018
Hi,
Although I have chosen the short format in the code and command window display preferences. The results after using a "solve" command are displayed as:
y =
7770/23 - (32083660183526053*R)/12947848928690176000
Can anybody help me so that I can view the numerical values in short format? Like:
y = 337.83 - 0.0024779*R
Thanks

Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Ag. de 2012
Use vpa()
  3 comentarios
Gombo Choigaalaa
Gombo Choigaalaa el 29 de Sept. de 2018
Editada: Walter Roberson el 29 de Sept. de 2018
>> x=3^4/(2^3+2-4.5);
>> x=14.7273 -looks ok but not short.
>> vpa(x)
ans =
14.727272727272727272727272727273 -is not short at all LOL
Walter Roberson
Walter Roberson el 29 de Sept. de 2018
By default vpa() pays attention to the current digits() setting, which defaults to 32. You can specify how many digits you want at the time of the vpa() call. For example,
>> vpa(x,5)
ans =
14.727

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Numbers and Precision en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by