Change the expression of number

11 vues (au cours des 30 derniers jours)
Quynh tran
Quynh tran le 24 Mai 2017
Commenté : Quynh tran le 25 Mai 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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by