Question: IN MATLAB Given variable A that contains a matrix with at least two rows, swap the first & last rows, as in the previous problem.
IN MATLAB
Given variable A that contains a matrix with at least two rows, swap the first & last rows, as in the previous problem. Multiply the swapped matrix element-by-element to variable A, and assign this result to variable B
Examples:
Input A = [1 2 3
4 5 6]
Output B = [4 5 6 * [1 2 3 = [4 10 18
1 2 3] 4 5 6] 4 10 18]
function B = SwapRowsMult1(A)
%replace the line below with code to swap the 1st and last row of A, array multiply it to A & store the result into B
B = A;
end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
