Sheet 2
Sheet 2
1. Use the MATLAB built-in rand function to define the matrix A8x10 and show how to use
MATLAB to implement the following matrix operations:
1. Eliminate the 3th row of matrix A
2. Eliminate the 5th column of matrix A
3. Covert the matrix A to one column.
4. Create a new matrix consists of rows 1,5,3,7,4 of matrix A
5. Create a new matrix consists of columns 1,3,9,5,7,6,4 of matrix A
2. Use the MATLAB built-in rand function to define a square matrix A5x5 and show how to
use MATLAB to implement the following matrix operations:
1. Obtain the upper triangular matrix of A
2. Obtain the lower triangular matrix of A
3. Obtain the diagonal matrix of A
4. Obtain the summation of principle diagonal elements.
5. Obtain the summation of each column expressed as a row vector.
3. Use the MATLAB built-in rand function to define a raw vector A1x15 and show how to use
MATLAB to implement the following operations:
1. Obtain the greater element of A
2. Obtain the smaller element of A
3. Rearrange the elements of A in ascending order.
4. Obtain the summation of vector elements.
5. Obtain the product of vector elements.