{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

E7_Lecture3_Su10+posted

# E7_Lecture3_Su10+posted - Introduction to arrays An array...

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

E7 L3 1 Introduction to arrays Introduction to arrays An array is an ordered collection of real numbers. MATLAB treats arrays very efficiently Input/output, indexing and addressing Arithmetic operations Other manipulations (e.g., sizing, reshaping, etc.) Arrays are the primary building blocks in MATLAB.

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

View Full Document
E7 L3 2 Introduction to arrays Introduction to arrays Examples 1-dimensional arrays: (1 row, 1 column) (1 row,4 columns) (3 rows, 1 column) [1] a = [ ] 1 5 3 2 b = - 2 1 3 c = -
E7 L3 3 Introduction to arrays Introduction to arrays Examples: 2-dimensional arrays (2 rows, 3 columns) (3 rows, 3 columns) 1.2 3.2 1.0 3.1 92 0.0 d - = 1 4 6 7 2 5 8 4 3 e =

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

View Full Document
E7 L3 4 One-dimensional arrays One-dimensional arrays Those that have one row or one column. Construction: Manual Incremental linspace transpose: zeros ones rand/randn
E7 L3 5 One-dimensional arrays – manual construction One-dimensional arrays – manual construction Row vectors: Syntax: [ element1 , element2 , ] >>r = [3,7,9] r = 3 7 9 , separates columns of an array [ starts the array ] ends the array [ ] 3 7 9 r =

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

View Full Document
E7 L3 6 One-dimensional arrays – manual construction One-dimensional arrays – manual construction Column vectors: Syntax: [ element1 ; element2 ; ] >>c = [3;7;9] c = 3 7 9 ; separates rows of an array [ starts the array ] ends the array 3 7 9 c     =      
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 26

E7_Lecture3_Su10+posted - Introduction to arrays An array...

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

View Full Document
Ask a homework question - tutors are online