Find number of decimal digits of a variable in MATLAB -
given variable x = 12.3442
i want know number of decimal digits of variable. in case result 4. how can without trial , error?
here compact way:
y = x.*10.^(1:20) find(y==round(y),1)
assumes x
number , 20 maximum number of decimal places.
Comments
Post a Comment