Scientific notation to decimal?
171 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anna
am 4 Aug. 2013
Kommentiert: Basílio Gonçalves
am 19 Okt. 2017
I currently have a number that I want in decimal form not scientific form. I have
Savings made in dollars:
1.0418e+06
How do I get the 1.0418e+06 into decimal? Is there a function for this? In my script file I have
disp('Savings made in dollars: ' )
disp(savings)
So I was wondering if there was a function that i can enter in the disp(savings) bit to make my number a decimal?
I am very new to MATLAB so a basic explanation is much appreciated.
0 Kommentare
Akzeptierte Antwort
dpb
am 4 Aug. 2013
>> sav=1.0418e+06;
With cents displayed...
>> disp(num2str(sav,'%.2f'))
1041800.00
Whole dollars...
>> disp(num2str(sav,'%.0f'))
1041800
Also see
doc fprintf % and friends
0 Kommentare
Weitere Antworten (2)
Siehe auch
Kategorien
Mehr zu MATLAB Report Generator 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!