This could be a simple thing and I'm just overlooking it. A little context, I am swapping out the first row with the last row in a non-square matrix, and then multiplying the new matrix with the original. I'm struggling to find a way to multiply the two matrices. I've tried with square matrices and it works perfectly so I'm at a bit of a loss for some reason.
A=[7 3 10 10 -2 39 -8 10 0 9 -10-8 -5 -7 6 6 79 1 10 -8 10 9];A([1 end],:) = A(end 1],:); % To swap the first and the last rows
B = A([end 1],:) .* A % Multiply the new swapped matrix with the original
Error using .* Matrix dimensions must agree.
Best Answer