How to truncate the array values?

조회 수: 7 (최근 30일)
Ad
Ad 2017년 4월 30일
댓글: Image Analyst 2017년 4월 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.

답변 (2개)

Star Strider
Star Strider 2017년 4월 30일
See the documentation on format (link).

Image Analyst
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
Ad
Ad 2017년 4월 30일
I am getting these results.
Image Analyst
Image Analyst 2017년 4월 30일
You can consider any value less than 1e-15 as essentially 0. It's just truncation error.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by