confusion about the format in MATLAB
Ältere Kommentare anzeigen
the example in MATLAB Document is when the format is short,
>>x = [4/3 1.2345e-6]
x =
1.3333 0.0000
but when i input
>>x = 1.2345e-6
x =
1.2345e-06
why i cannot get the 0.0000?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 7 Jul. 2019
0 Stimmen
format short does not mean 5 digits after the decimal place. format short takes the largest absolute value out of all of the values on the 2d plane and uses 5 digits for that, and everything else is scaled according to that.
The only format option for a fixed number of decimal places is format bank for 2 digits.
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!