How to truncate the array values?
9 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
Image Analyst
2017-4-30
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 个评论
Image Analyst
2017-4-30
You can consider any value less than 1e-15 as essentially 0. It's just truncation error.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!