Functions > Vector and Matrix > Creating and Subdividing Arrays > Example: Inserting and Extracting Subarrays
  
Example: Inserting and Extracting Subarrays
Inserting a Subarray
Insert an array at a given position in a larger array, replacing the original elements.
1. Define the larger array:
Click to copy this expression
2. Define the smaller array:
Click to copy this expression
3. Enter the row and column number where the upper-left element of the smaller array goes:
Click to copy this expression
Click to copy this expression
4. Insert matrix B at position (r, c) inside of matrix A:
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
Extracting a Subarray
1. Define the input matrix:
Click to copy this expression
2. Extract all elements common to rows 1 and 2 and columns 0, 1, and 2:
Click to copy this expression
3. To reverse the order of the columns, swap the last two scalar arguments:
Click to copy this expression
4. To reverse the order of the rows, swap the first two scalar arguments:
Click to copy this expression