Consider the linear system AX=B,where A={{3, 0, 2}, {-3, 2, 2}, {2, -3, 3}}
,B={{3}, {-1}, {4}}
and x={{x},{y},{z}}
.So i tried like this:
A1 = {{, ,}, {, ,}, {, ,}}; A3 = {{, ,}, {, ,}, {, ,}}; A2 = {{, ,}, \
{, ,}, {, ,}}; For[i = 1, i <= 3, i++,
For[j = 1, j <= 3, j++,
If[j == 1, A1[[i, j]] = B[[i, 1]], A1[[i, j]] = A[[i, j]]]]]; For[
i = 1, i <= 3, i++,
For[j = 1, j <= 3, j++,
If[j == 2, A2[[i, j]] = B[[i, 1]], A2[[i, j]] = A[[i, j]]]]]; For[
i = 1, i <= 3, i++,
For[j = 1, j <= 3, j++,
If[j == 3, A3[[i, j]] = B[[i, 1]],
A3[[i, j]] = A[[i, j]]]]]; x = (Det[A1]/Det[A]); y = (Det[A2]/
Det[A]); z = (Det[A3]/Det[A]); Print["x=", x, " y=", y, " z=", z]
But i want to do this using only one loop.i am new user of mathematica.So can Anyone help me to figure out this. Any hints or solution will be appreciated.
Thanks in Advanced.