EGR_102_Lab_03B_MATLAB_Basics

EGR_102_Lab_03B_MATLAB_Basics - MATLAB Basics EGR 102 - Lab...

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

View Full Document Right Arrow Icon
MATLAB ® Basics EGR 102 - Lab 03B 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 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
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2012 for the course EGR 100 taught by Professor Hinds during the Fall '08 term at Michigan State University.

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 Right Arrow Icon
Ask a homework question - tutors are online