Part9 - Mtidimensional Arrays Part 1
Part9 - Mtidimensional Arrays Part 1
Email: Mohammad_Arafah@Hotmail.com
YouTube: http://www.youtube.com/channel/UCJ-YdxBHdbLFz-mLYWC4c0w
Facebook : Mohammad Emad Arafah
1- Creating, Indexing Multidimensional Arrays
An array having more than two dimensions is called a multidimensional array in the MATLAB application.
Matrices have two dimensions: the row dimension and the column dimension.
You can access a two-dimensional matrix element
with two subscripts: the first representing the
row index, and the second representing the
column index.
Multidimensional arrays use additional subscripts for
indexing. A three-dimensional array, for example, uses
three subscripts.
To access the element in the second row, third column of page 2, for
example, you use the subscripts (2,3,2).
1- increment or add the appropriate subscript and assign the desired values.
2- Assign the same number of elements to corresponding array dimensions. For numeric
arrays, all rows must have the same number of elements, all pages must have the same
number of rows and columns, and so on
1- Creating, Indexing Multidimensional Arrays
You can take advantage of the MATLAB scalar expansion capabilities, together with the colon
operator, to fill an entire dimension with a single value:
Note that after the first two assignments MATLAB pads A with zeros, as needed, to maintain
the corresponding sizes of dimensions.
1- Creating, Indexing Multidimensional Arrays
Generating Arrays Using MATLAB Functions :
You can use MATLAB functions such as randn, ones, and zeros to generate
multidimensional arrays in the same way you use them for two-dimensional arrays.
1- Creating, Indexing Multidimensional Arrays
Building Multidimensional Arrays with the cat Function :
The cat function is a simple way to build multidimensional arrays; it concatenates a list of
arrays along a specified dimension:
where A1, A2, and so on are the arrays to concatenate, and dim is the dimension along which
to concatenate the arrays.
Note: The cat function accepts any combination of
existing and new data.
2- Accessing Multidimensional Array Properties
You can use the following MATLAB functions to get information about multidimensional
arrays you have created.
Thanks For Your Listening