HOMEWORK (1)
Question 1: Compute the following expressions using MATLAB:
Question 2: Create variables to represent the following matrices:
a. Assign to the variable x1 the value of the second column of matrix A.
b. Assign to the variable x2 the third column of matrix B.
c. Assign to the variable x3 the third row of matrix B.
d. Assign to the variable x4 the first three values of matrix A as the first row,
and all the values in matrix B as the second, third and fourth rows, and
transposed of C as fifth row.
Question 3:
If matrix A is defined using the MATLAB code A = [1 3 2; 2 1 1; 3 2 3], which
command will produce the following matrix from A?
Question 4: Create matrices A and B then answer the following questions:
a. C =A* B
b. Inverse of matrix A.
c. Sum the first row of matrix B.
d. Delete the second column of matrix A.
2 3
e. Add matrix D = 4 5 to matrix A.
6 7
Question 5:
Use a single command to create a row vector (assign it to a variable named b) with
8 elements that the first three elements are 3.8 and the rest of the elements are 0s.
Do not type the vector elements explicitly.