1 function outArr =
roundn(inpArr,indexExp)
3 if ~(isscalar(indexExp)&&(fix(indexExp)==indexExp))
5 'indexExp is expected to be an integer scalar');
9 multVal = 10 ^ -indexExp;
10 outArr = round(multVal * inpArr) / multVal;
12 multVal = 10 ^ indexExp;
13 outArr = multVal * round(inpArr / multVal);
15 outArr = round(inpArr);
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function roundn(in inpArr, in indexExp)
ROUNDN rounds to multiple of 10^indexExp.