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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -