IF reading matrix values without preceding scientific notation

1 次查看(过去 30 天)
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.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by