E7_Lecture3_Su10+posted

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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
E7 L3 2 Introduction to arrays Introduction to arrays Examples 1-dimensional arrays: (1 row, 1 column) (1 row,4 columns) (3 rows, 1 [1] a = [ ] 1 5 3 2 b = - 2 1 3 c = -
Background image of page 2
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 =
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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 =
Background image of page 5

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

View Full DocumentRight Arrow Icon
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     =      
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/14/2010 for the course E 7 taught by Professor Patzek during the Summer '08 term at University of California, Berkeley.

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 Right Arrow Icon
Ask a homework question - tutors are online