why two = for elseif
1 view (last 30 days)
Walter Roberson on 15 Oct 2011
In MATLAB, a single = is either direct assignment or a representation that assignment will happen (such as in a "for K=1:10" statement.)
In MATLAB, == is always comparison of values.
There are other comparison operators that include a single = as part of the token, such as <= . That must be read as a pair, not as "<" and "=" separately, just like "if" is not the same thing as "i f".