MATLAB: Round off to nearest 5 instead of 10 round-off is that any way to round off to nearest 5 instead of 10? for example, round off 346 to 345; 293 to 295; 296 to 295; thx for help :p Best Answer round( x / 5 ) * 5; Related SolutionsMATLAB: Nearest value but bigger nearest k = bsxfun(@minus,A(:)',B(:)); k(k >= 0) = -inf;[~,ii] = max(k);ii(all(k == -inf)) = 0; MATLAB: Rounding numbers in a specific values multiply by 2, round to the nearest integer, divide back by 2 => round to the nearest 1/2:>> Num = 10.25;>> round(Num*2)/2ans = 10.5 Related QuestionHow to prevent Matlab from randomly adding trailing zeros to integersRound to nearest odd integerIs there a way to floor to a specified number of digitsInterpolation Nearest Neighbor
Best Answer