IF reading matrix values without preceding scientific notation

I am currently trying to run the following statement within a script as a check (Matrix is considered non-zero below 1e-14):
if any(abs(B))>1e-14
display('ERROR: B-Matrix is non-zero')
return
end
Where B is a matrix where all elements are preceded by the scientific notation 1e-15 (i.e. the if statement should return a false. However is appears as though the statement is reading the numbers in the matrix without multiplying through the scientific notation (i.e. the if statement behaves as if it is looking for any(abs(B))>1.
Any guidance would be greatly appreciated.

댓글 수: 1

Apologies, for the sentence within the embedded code, couldn't get it to work.

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

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2016년 2월 11일
I think it should be
if any(abs(B)>1e-14)
Do you see the difference?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

제품

질문:

2016년 2월 11일

댓글:

2016년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by