class_notes15

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

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

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)

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

View Full Document
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.
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

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

View Full Document
Conditional Statements if logical expression commands elseif logical expression commands else commands end The if statement allows the program to make decisions.
Repetition – for loops for loop variable = m:s:n statements end The for loop is useful for counter controlled repetition, when the

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.

## 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
Ask a homework question - tutors are online