Lecture_02_Variables_p6

Lecture_02_Variables_p6 - Lecture 2 Variables and Basic...

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

View Full Document Right Arrow Icon
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. 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. Place the following variables in the work space. Arrays and Matrices (doubles)
Background image of page 1

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

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

This note was uploaded on 09/07/2011 for the course ENGIN 7 taught by Professor Horowitz during the Spring '08 term at Berkeley.

Page1 / 3

Lecture_02_Variables_p6 - Lecture 2 Variables and Basic...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online