How to separate integers and decimal numbers from given values?
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How to separate integers and decimal numbers from given values?
1 Kommentar
Antworten (3)
Star Strider
am 21 Jul. 2016
If you want to separate the value to the left and right of the decimal point, this works:
LD_RD = @(x) [fix(x) rem(x,1)]; % Separates Numbers Left & Right Of The Decimal
v = [1 2.1 pi 10 8.125]';
Result = [v LD_RD(v)]
Result =
1 1 0
2.1 2 0.1
3.1416 3 0.14159
10 10 0
8.125 8 0.125
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!