Borrar filtros
Borrar filtros

Change the expression of number

2 visualizaciones (últimos 30 días)
Quynh tran
Quynh tran el 24 de Mayo de 2017
Comentada: Quynh tran el 25 de Mayo de 2017
Dear all,
I have this number
A=0.1235689745654
but when I need to show it, just only 4 number after dot "." was shown like this.
A =0.1236
But I want it's shown like this
A=0.1235689745654
Could you help me to fix it. Thanks

Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de Mayo de 2017
format long g
and then display the number
  5 comentarios
Walter Roberson
Walter Roberson el 25 de Mayo de 2017
fprintf('%.15g', A)
Quynh tran
Quynh tran el 25 de Mayo de 2017
Thank you so much @Walter Roberson

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by