Lecture_02_Variables_p2

# Lecture_02_Variables_p2 - Lecture 2 Variables and Basic...

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

1 1. Assigning variables 2. Arrays and matrices 3. Operations on arrays 4. Char arrays 5. Struct arrays 6. Cell arrays Lecture 2: Variables and Basic Data Structures Variable (Layman): Something that is subject to variation. i.e. weather. Variable (Mathematics): A representation of an unknown quantity. Variable (Programming, E7): A name associated with a known value. What is a variable? Note: In Matlab, all variables are arrays.

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

View Full Document
2 1. Double (numbers) 2. Char (letters and words) 3. Struct (structured data) 4. Cell (unstructured data) Data Types The Assignment Operator, = Assigns the value 1 to the variable x. Now x behaves like 1 Assigns y to 2 Now y is in the workspace and is equal to 2 Assigns the sum of x and y to the variable z Now z is in the workspace and is equal to x+y, which is 1+2, which is 3 Assigns a known value to a variable name.
3 Place the following variables in the work space. Arrays and Matrices (doubles)

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 / 9

Lecture_02_Variables_p2 - Lecture 2 Variables and Basic...

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

View Full Document
Ask a homework question - tutors are online