Filter löschen
Filter löschen

Change the expression of number

2 Ansichten (letzte 30 Tage)
Quynh tran
Quynh tran am 24 Mai 2017
Kommentiert: Quynh tran am 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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by