MATLAB: Matlab row Subtraction operation change only 2nd row

matrix manipulation

In Matlab after subtraction operation of row2 of the same matrix(eg:-row2' = row2-row1) how to rewrite the resulatant matrix where 1st row is as it is and 2nd row' = row2 – row1 A'=[row1; row2']

Best Answer

Aprime = A;
Aprime(2,:) = Aprime(2,:) - Aprime(1,:);