Study Guides (380,000)
CA (150,000)
Ryerson (10,000)
CPS (40)
Final

CPS 118 Study Guide - Final Guide: Deconvolution, C Mathematical Functions, Relational Operator


Department
Computer Science
Course Code
CPS 118
Professor
Joshua D.Panar
Study Guide
Final

This preview shows half of the first page. to view the full 2 pages of the document.
CPS 118 final notes
Lesson 08
Relational comparisons
1 true value
0 false value
Comparison / Relational Operators
= = equal to
May store the comparison answer in a vector
V=gandalf= =frodo
numbers=1:10;
multiples_of_3=numbers(rem(numbers,3))
Logical Operator Truth Table
A B A&B OR | XOR , NOT~
False False False False False
False True False True True
True False False True True
True True True True False
Operators Precedence Rule
1. Parentheses ( )
2. Exponentiation exp( )
3. Logical NOT ~
4. Multiplication, division * /
5. Addition, subtraction +-
6. Relational operators (>, <, >=, <=, ==, ~=)
7. Logical AND &
8. Logical OR |
X an even number
mod(x,2)= = 0
??? ‘Z’= = ‘z’
Built-in Logical Functions
All(A)
Any(A)=[0 1 0]
Find(A>d)
A=[2 3 4;5 2 6;7 8 9];
Even=find(mod(a,2)==0);
You're Reading a Preview

Unlock to view full version