MATLAB: There is no truncate function in Matlab

functionmathematicstruncate

Hi,
I need to truncate values in a For loop and round() isn't working. I was just wondering why there is no truncate function yet?

Best Answer

Because round sometimes rounds up - away from zero. I think you may want to use fix() instead of round(). It always rounds towards zero, in other words, truncates. See if that works for you and let me know.