% % For A321 course % % Last Modified: Mon 04 Feb 2008, 09:05 AM % % % Can combine or negate relational expressions giving true/false using % the usual logical Boolean operators and, not, or. In matlab, % % ---------------- ------ % Boolean operator symbol % ---------------- ------ % and & % or | % not ~ % % Those follow the usual Boolean rules: when t = true and f = false, % % t & t = t % f & t = f % t & f = f % f & f = f % % t | t = t % f | t = t % t | f = t % f | f = f % % ~ t = f % ~ f = t % a = -3:5 ~a % Since true and false are represented in Matlab via 1 and 0, it can % be confusing at times whether an integer/double or boolean is meant!