Lecture 3 Notes

2 how can we express 5 x 6 eg 24 is

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: true? E.g., we can ask if xc is outside of [L,R], i.e., “is xc < L or R < xc ?” In code: xc<L || R<xc! 1/30/14 7 Logical Operators && 1/30/14 8 “Truth table” Matlab uses 0 to represent false, 1 to represent true logical and: Are both condi=ons true? X 0 1/30/14 ~Y “not” 0 0 1 1 0 1 0 0 0 1 1 1 9 X || Y “or” 1 ~ logical not: Nega=on E.g., we can ask if xc is not outside [L,R]. In code: ~(xc<L || R<xc)! 0 0 | | logical or: Is at least one condi=on true? Y 1 1 1 0 X && Y “and” 1/30/14 10 Operator Precedence (Highest to Lowest) 1.  ( ) 2.  ^ •  How can we express 5 < x < 6? e.g., 2^4 is 2 raised to the 4th power 3.  single argument +, - , ~ e.g., +1, 10 + - 10 * 10, ~...
View Full Document

This document was uploaded on 03/11/2014 for the course CSCI 004 at Brown.

Ask a homework question - tutors are online