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 -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -