Decimal format for values less than 1

Respuestas (1)

Star Strider
Star Strider el 30 de Mzo. de 2018

0 votos

See the documentation on the format (link) function.

4 comentarios

Tausif Raza
Tausif Raza el 30 de Mzo. de 2018
I am using format long and I get output for upto 4 digits after decimal but still when I input values less than 1 like x = 0.000015 matlab gives 1.500e-05
Star Strider
Star Strider el 30 de Mzo. de 2018
Unless you want to write your own sprintf calls, format is the only option I know of.
format long g
helps, but only up to 3 zeros before the first digit.
For smaller numbers, you need to sprintf() or fprintf()
Tausif Raza
Tausif Raza el 31 de Mzo. de 2018
Ok thanks

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 30 de Mzo. de 2018

Comentada:

el 31 de Mzo. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by