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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -