Rounding Values
Rounding Values
(OP)
Hi
I need to roung the values in a matrix for example i have a vector A = [0.151 0.155 1.12 1.17 2.25 2.31] and tolerance is 0.05. then i should get the result as
B = [0.155 0.155 1.17 1.17 2.25 2.31]. So i must be able to round the values to the max or min which falls in the range of 0.05. please let me know if there is some function or there is any other way round to get this.
Thanks in advance
Prasanna
I need to roung the values in a matrix for example i have a vector A = [0.151 0.155 1.12 1.17 2.25 2.31] and tolerance is 0.05. then i should get the result as
B = [0.155 0.155 1.17 1.17 2.25 2.31]. So i must be able to round the values to the max or min which falls in the range of 0.05. please let me know if there is some function or there is any other way round to get this.
Thanks in advance
Prasanna





RE: Rounding Values
Your example is confusing. you say 0.05, but you're rounding to 0.005. In the latter case, 0.151 should round to 0.150, not 0.155. If this is correct, then you should divide all the numbers by 5, round to 3 decimal places and multiply by 5.
TTFN