{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

EGR_102_Lab_03B_MATLAB_Basics

# EGR_102_Lab_03B_MATLAB_Basics - MATLAB Basics EGR 102 Lab...

This preview shows pages 1–6. Sign up to view the full content.

MATLAB ® Basics EGR 102 - Lab 03B 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Arithmetic Operators Arithmetic Operators: unary minus - -x addition + x + y subtraction - a - 22 multiplication * pi * r division / circ / diam exponential ^ radius ^ 2 EGR 102 - Lab 03B 2
Relational Operators Relational Operators: less than < x < y less than, equal to <= a<=22 equal to == x==100 not equal to ~= x~=25 greater than > classavg>90 greater than, equal to >= q>=57 EGR 102 - Lab 03B 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Relational Operators Example: Compute the average of 2 numbers & ask MATLAB if the average is greater than a particular value >> student1 = 75 >> student2 = 92 >> average = (student1 + student2) / 2 >> classaverage = (average > 80) Why didn’t the answer indicate Yes or No? (the average is 83.5) EGR 102 - Lab 03B 4
Logical Values MATLAB deals with logical values and logical variables There are an infinite number of numerical values, but only 2 possible logical values exist: True and False In MATLAB, logic values are assigned to numbers 0 viewed as False 1 or any other number viewed as True EGR 102 - Lab 03B 5

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

### Page1 / 14

EGR_102_Lab_03B_MATLAB_Basics - MATLAB Basics EGR 102 Lab...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online