MatLab Code Given the following Matrix B2 5 8 9 1 4 7 7 0 3
**MatLab Code**
Given the following Matrix: B=[2 5 8 9
1 4 7 7
0 3 3 6
2 6 1 7]
perform the following operations:
a) Perform element-by-element multiplication with the 2nd row and the 3rd column of matrix B
b) Replace the fourth column of matrix B with the resulting numbers in part a). (It is not acceptable to simply rewrite matrix A with the new numbers)
c) Delete the third row of matrix B.
The initial matrix and the resulting matrix after part c) MUST be stored in the variable B.
Copy and paste your code below.
Solution
clc
clear all
B=[2 5 8 9;1 4 7 7;0 3 3 6;2 6 1 7]
A=B(2,:);
C=(B(:,3))\';
D=A.*C % element by element multiplication
B(:,4)=D\' % replacing the 4th column
E = B( [1:2,4] , : ) % deleting 3rd row of matrix
![**MatLab Code** Given the following Matrix: B=[2 5 8 9 1 4 7 7 0 3 3 6 2 6 1 7] perform the following operations: a) Perform element-by-element multiplication w **MatLab Code** Given the following Matrix: B=[2 5 8 9 1 4 7 7 0 3 3 6 2 6 1 7] perform the following operations: a) Perform element-by-element multiplication w](/WebImages/13/matlab-code-given-the-following-matrix-b2-5-8-9-1-4-7-7-0-3-1014502-1761524029-0.webp)