\cat programming
MATLAB treats every variable as a matrix and it may result in unexpected errors. Be careful!
- isequal()
a = 1; size(a) == 1
=> 1 = 1 = TRUE
- strcmp() returns 1 as TRUE and 0 as FALSE. (different from C)
'abc' == 'abcd' may not be what you want because it creates a matrix:
=> 1 = 0 = TRUE
- How to implement (condition?true:false)
=> ((condition)*(true)+(~(condition))*(false))