Borrar filtros
Borrar filtros

how to display number in decimal ?

64 visualizaciones (últimos 30 días)
Reema Alhassan
Reema Alhassan el 13 de Jul. de 2018
Respondida: Steven Lord el 14 de Jul. de 2018
Hello everyone, I have tried :
format long
format short
value=double(value)
and the output still fraction number how can I convert it to decimal ?
  3 comentarios
Walter Roberson
Walter Roberson el 13 de Jul. de 2018
int(value) is an error unless the value is symbolic.
Perhaps the user wants
format bank
for 2 decimal places. Or perhaps the user wants fix() or floor() . Or perhaps round() with a particular number of decimal places.

Iniciar sesión para comentar.

Respuestas (1)

Steven Lord
Steven Lord el 14 de Jul. de 2018
Since it's likely the "fraction number" is stored as a symbolic object, try calling either the vpa function or the double function with your symbolic number as input.

Categorías

Más información sobre Logical 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