Info

此问题已关闭。 请重新打开它进行编辑或回答。

how to use the compare signal in m-file (>/<)

3 次查看(过去 30 天)
mayuresh
mayuresh 2012-7-25
关闭: MATLAB Answer Bot 2021-8-20
m-file

回答(1 个)

Walter Roberson
Walter Roberson 2012-7-25
If you are comparing vectors or arrays, please be sure to note this behavior of if
An evaluated expression is true when the result is nonempty and contains all nonzero elements (logical or real numeric). Otherwise, the expression is false.
So when you have
if A < B
and A or B is a vector (or a matrix) then the "if" is only considered true if all A < B are true.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by