12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

a(:,:,3) =3 3 33 3 33 3 3Indexing for multidimensional arrays works in the same way as twodimensionalarrays;>> a(2,:,1)ans =4 5 6>> a(2,:,2)ans =8 10 12>> a(2,:,:)ans(:,:,1) =4 5 6ans(:,:,2) =8 10 12ans(:,:,3) =3 3 3Data can be removed from multidimensional arrays by using the emptymatrix:>> a(:,:,2) = []a(:,:,1) =1 2 34 5 67 8 9a(:,:,2) =3 3 33 3 33 3 3Elements can be columnarly extracted from multidimensional arrays inthe same way as they are from two-dimensional arrays:>> a(:)’ans =Columns 1 through 121 4 7 2 5 8 3 6 9 3 3 3Columns 13through 183 3 3 3 3 329.1 Generating Multidimensional GridsThe function meshgrid can be used to create matrices representingevenly-spaced grids <strong>of</strong> points.c○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!