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

by OC297612

School

Ryerson UniversityDepartment

Computer ScienceCourse Code

CPS 118Professor

Joshua D.PanarStudy Guide

FinalThis

**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