Lecture_02_Variables_p2

Lecture_02_Variables_p2 - Lecture 2 Variables and Basic...

Info iconThis preview shows pages 1–4. 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.
Background image of page 1

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

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

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

View Full Document Right Arrow Icon
Image of page 4
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 Right Arrow Icon
Ask a homework question - tutors are online