Department

Engineering

Course Code

ENGR 101

Professor

Jeffrey Ringenberg

It#checks#the#current#value#of#X#and#sees#if#it#less#than#5

â—‹

The#result#is#called# a#truth%value,%it#is#

â—‹

X#<#5#

o

either#false#(0)#or#true#(1)

Consider#the#following#equation:

â€¢

â€¢

If#both#are#true,#the#whole#is#true#

â—‹

The#&%operator#implements#logical%and%

o

Logical%operator%can#combine#two#truth#values#according#to#the#rules#of#formal%logic%

â€¢

One#or#the#other,#or#both

â—‹

Inclusive%or%(or)

o

One#or#the#other,#but#NOT#both

â—‹

Exclusive%or (xor)

o

Inclusive#or#exclusive#"or"

â€¢

â€¢

If#x#=#10,#it'll#=#1#

o

Write#1#<#x#&#x#<#5

o

Don't#write#1#<#x#<#5

â€¢

1s#and#0s#in#a#logical#array#are#completely#different#type#of#data#than#regular#

numbers#

o

When#we#put#a#[regular#array]#between#the#()#in#an#indexing#expression,#we#

select#those#indices.

o

The#result#of#a#relational#or#logical#operator#is#a#logical%array%

â€¢

==#are#for#logical# operators,#while#=#aren't#

â€¢

Ex.#logical[1,0;0,1]#

o

If#you#want#to#hardcore#a#logical#matrix,#you#need#to#wrap#it#up#in#the#logical#function

â€¢

Any#=#any#nonzero#number#in#a#matrix,#vector,#scalarâ€¦#

â€¢

All#=#evaluates#if#all#elements#are#nonzero.#

â€¢

â€¢

Logical(operator(

Wednesday,# September# 27,#2017

9:49#AM

Over 90% improved by at least one letter grade.

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah â€” University of Toronto

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim â€” University of Michigan

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna â€” University of Wisconsin

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne â€” University of California

Join OneClass

Access over 10 million pages of study

documents for 1.3 million courses.

Sign up

Join to view

OR

By registering, I agree to the
Terms
and
Privacy Policies

Already have an account?
Log in

Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.