Class Notes (1,049,957)
US (413,493)
U of M (7,083)
ENGR (63)
Lecture 3

ENGR 101 Lecture Notes - Lecture 3: Logical Connective, Exclusive Or, Logical Matrix

3 pages101 viewsFall 2017

Department
Engineering
Course Code
ENGR 101
Professor
Jeffrey Ringenberg
Lecture
3

This preview shows half of the first page. to view the full 3 pages of the document.
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
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
You're Reading a Preview

Unlock to view full version


Loved by over 2.2 million students

Over 90% improved by at least one letter grade.