Suppose that I have the following matrix:
matrix = Table[i+j, {i, 5}, {j, 0, 4}];
which generates
I like to write a Mathematica
function such as mm[matrix_]
to conduct linear operations using rows and columns. For example, summing 1st and 4th columns and summing 2nd row with 5th row. The resulting function should be obtained using mm[matrix_]
. The position of the new column and row is not important for my purpose.
The output should be:
{{2 3 5 5},
{9 11 20 15},
{4 5 9 7},
{5 6 11 8}}
Thanks.
Tugrul