How to truncate the array values?

11 vues (au cours des 30 derniers jours)
Ad
Ad le 30 Avr 2017
Commenté : Image Analyst le 30 Avr 2017
My 400*400 array looks like this.
I want to truncate those exponential 'e'values from the array. for example 3.7267e-04 to 3.7267
Thanks in advance.

Réponses (2)

Star Strider
Star Strider le 30 Avr 2017
See the documentation on format (link).

Image Analyst
Image Analyst le 30 Avr 2017
Just on a chance that you want the mantissa but no exponent:
a=[1.2e-6, 3.4e-7, 8.9e-10]
exponents = ceil(log10(a))-1
out = a .* 10.^exponents % Numerical values
  2 commentaires
Ad
Ad le 30 Avr 2017
I am getting these results.
Image Analyst
Image Analyst le 30 Avr 2017
You can consider any value less than 1e-15 as essentially 0. It's just truncation error.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Computer Vision Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by