Matlab madness

Okay, time for some Matlab annoyances.

[] is the empty matrix.
| is logical or.

[] | 1 evaluates to []. In other words,

if ( [] | 1 )
  function();
end

will never call function.

This entry was posted in The wonderful world of non-free software. Bookmark the permalink.

One Response to Matlab madness

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>