lecture_7

# lecture_7 - Lecture 7 Comp 116 Feb 2nd 2009 So far...

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

Click to edit Master subtitle style 10/6/09 Lecture 7 Comp 116 Feb 2nd, 2009

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

View Full Document
10/6/09 So far… Programs (m-files) Execute statements in order One path through code How do we Sometimes do one thing Sometimes do another
10/6/09 Logical expressions

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

View Full Document
10/6/09 Conditional Execution Guess a number. ..
10/6/09 Logical Data Type Two values false or true 0 or 1 Conceptually: 1 bit MATLAB: logical, 1 byte

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

View Full Document
10/6/09 Relational Operators Test relationships between values operands: any data type result: logical
10/6/09 Relational Operators Scalar – Scalar (1 x 1) <= (1 x 1) Array – Scalar (m x n) == (1 x 1) (1 x 1) ~= (m x n) Array – Array (matching sizes) (m x n) > (m x n)

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

View Full Document
10/6/09 Examples x = [1 2; 3 4] y = [2, -2]
10/6/09 Precision Try this in MATLAB

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

View Full Document
10/6/09 Logical Operators Work with logical data types operands: logical result: logical help relop
Logical Operators ~ is unary

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 03/22/2009 for the course COMP 116 taught by Professor Stotts during the Spring '08 term at UNC.

### Page1 / 27

lecture_7 - Lecture 7 Comp 116 Feb 2nd 2009 So far...

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

View Full Document
Ask a homework question - tutors are online