class_notes15

class_notes15 - Engineering 3 Class 15 Today: more Matlab...

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

View Full Document Right Arrow Icon
Engineering 3 – Class 15 Today: • more Matlab control structures • Matlab arrays • Midterm return Note: Assignment 4 will be posted shortly after class. It will be due Sept. 5 th at 11:59pm. The final will be on Sept. 13 th , 9:30 HFH (Eng 1) 1104 (this room)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Relational Operators • six relational operators… < less than <= less than or equal to > greater than >= greater than or equal to == equal to ~= not equal to This compares arrays on element by element basis.
Background image of page 2
Logical Expressions • similar to C, MATLAB has 5 logical operators ~ NOT (swaps zeros with nonzeros) & AND (arrays, element by element) | OR (arrays…) && Short circuit AND (scalars only) || Short circuit OR (scalars only) Remember: nonzero == TRUE zero == FALSE
Background image of page 3

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

View Full DocumentRight Arrow Icon
Conditional Statements if logical expression commands elseif logical expression commands else commands end The if statement allows the program to make decisions.
Background image of page 4
Repetition – for loops for loop variable = m:s:n statements end The for loop is useful for counter controlled repetition, when the
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 08/06/2010 for the course ENGR 3 taught by Professor Ben-yaakov during the Summer '08 term at UCSB.

Page1 / 10

class_notes15 - Engineering 3 Class 15 Today: more Matlab...

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