For some reason, the "truncate" function of Matlab is called fix. So
>> fix(3.5)
ans = 3
>> fix(-3.5)
ans = -3
To truncate, round, gender, or place something by a given number of decimal places, multiply by decimal numbers, truncate, circle, gender, or gender, and then divide the result by dozens.
So:
>> fix(123.456 * 10^2)
ans = 12345
>> ans / 10^2
ans = 123.45
source
share