ALCANTARA 1912451 SimulationActivity2.1 MatrixInMATLAB
ALCANTARA 1912451 SimulationActivity2.1 MatrixInMATLAB
Section: CE21S1
A2 = [pi*ones(1,5);ones(1,5);zeros(1,5);ones(1,5)]
A3 = [sqrt(2)*ones(3)]
B. In MATLAB enter the following matrices use appropriate format. Write your syntax in the space provided.
MATLAB Syntax
1. Product of A and C
MATLAB SYNTAX
B1 = A*C
MATLAB OUTPUT
MATLAB SYNTAX
B2 = A+C'
MATLAB OUTPUT
B2 = 5 3/2
19/12 9/4
49/20 19/6
MATLAB SYNTAX
B3 = 6*A'-2*(C*B')
MATLAB OUTPUT
Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns
in the first matrix matches the number of rows in the second matrix. To perform element wise
multiplication, use '.*'.
The matrices C and B’ have no product because they don’t have the same inner dimension.
Therefore, the expression in item number three is not possible.
4. Sum of the product of A and its transpose and the product of C and its transpose.
MATLAB SYNTAX
B4 = (A*A')+(C*C')
MATLAB OUTPUT
The two matrices have no sum because they have different dimensions. Therefore, the expression
in item number four is not possible.
5. Product of A and B
MATLAB SYNTAX
B5 = A*B
MATLAB OUTPUT
Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns
in the first matrix matches the number of rows in the second matrix. To perform element wise
multiplication, use '.*'.
The matrices A and B have no product because they don’t have the same inner dimension.
Therefore, the expression in item number five is not possible.
“I affirm that I shall not give or receive any unauthorized help on this assignment
and that all work is my own”