joining integer ans decimal part of number
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 2 numbers say 100 and 0.025 and I want to print them as 100.025, how this could be done?
0 Kommentare
Antworten (1)
Star Strider
am 29 Aug. 2018
The easiest way is to just add them:
n1 = 100
n2 = 0.025
N = n1+n2
To print them:
sprintf('%.3f', n1+n2)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing 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!