MATLAB: Please i want to solve linear equations which takes the form of AX=B where x is the unknown variables but i have another unknown in row 2 of matrix B how i can not solve this problem

iterative linear equation

matrix
A=[2-j*3 -0.9+j*9 0 0 0 -1+j*19;
-0.9+j*9 2-j*3 j*9 0 0 -1+j*9;
0 j*9 17-j*3 -17+j*2 0 0;
0 0 -17+j*2 17-j*4 j*2 0;
0 0 0 j*2 -j*25 0;
-1+j*19 -1+j*19 0 0 0 3-j*39; ];
B=[5;y;0;0;2;0]; % y is the unknown variable
X=[x1;x2;x3;x4;x5;x6]
i want to find the values of matrix x and the value of y
how i can solve these lonear equations

Best Answer

You have 6 equations in 7 unknowns. You do not have enough information to determine all of the variables x1, x2, x3, x4, x5, x6, and y .
syms y x1 x2 x3 x4 x5 x6
A=[2-j*3 -0.9+j*9 0 0 0 -1+j*19;
-0.9+j*9 2-j*3 j*9 0 0 -1+j*9;
0 j*9 17-j*3 -17+j*2 0 0;
0 0 -17+j*2 17-j*4 j*2 0;
0 0 0 j*2 -j*25 0;
-1+j*19 -1+j*19 0 0 0 3-j*39; ];
B=[5;y;0;0;2;0]; % y is the unknown variable
X=[x1;x2;x3;x4;x5;x6];
sol = solve(A*X == B, X)
This will have sol.x1 through sol.x6, all dependent on the variable y. If you knew any one x* value then you could calculate y. For example,
Y = solve(sol.x1 == 3+4*j, y)
Related Question