i have matrix A and C how can i find the relation between element of matrix B? A*B=C

hello every one i have 3 different matrix such as A=[a b;c d] and B=[X1;X2] and C=[K;K2] then A*B=C how can i find i find the relation between element of matrix B? can you explain thank you

Answers (1)

I’m letting the Symbolic Math Toolbox do this for me this morning:
syms a b c d X1 X2 K1 K2
A=[a b;c d];
B=[X1;X2];
C=[K1;K2];
Eqn = A*B == C;
[X1,X2] = solve(Eqn, B)
X1 =
-(K2*b - K1*d)/(a*d - b*c)
X2 =
(K2*a - K1*c)/(a*d - b*c)

8 Comments

i have one question if we have value for A and C still we use same method or different method? thank you
Essentially the same method, although if you have numbers in the ‘A’ matrix and ‘C’ vector, use the backslant (\) operator (or the mldivide function) instead:
B = A\C
That also works in the Symbolic Math Toolbox:
syms a b c d X1 X2 K1 K2
A=[a b;c d];
B=[X1;X2];
C=[K1;K2];
B = A\C
B =
-(K2*b - K1*d)/(a*d - b*c)
(K2*a - K1*c)/(a*d - b*c)
thanks for your response, i tried ur solution i have one more question because my result matrix i mean C is zeros matrix of (2,1) it give me 0 to result of X1 and X2 is it any way we find this in relation way such as X2=5X1 for example if we input value for matrix a can u help me with that? thank you
My pleasure.
If C is [0; 0] (that is, ‘K1’ and ‘K2’ are both 0), then ‘B’ will also be [0; 0] regardless of whatever ‘A’ is (unless it is also a zeros matrix, in which instance ‘B’ will be [NaN; NaN].)
If both [X1; X2] are [0; 0], then of course X2=5*X1.
thank you so by using the equation in above you write i can get some answer like X1=5X2 i mean or this is impossible to do in matlab?
I am not certain that I understand what you want to do. If you want to solve for ‘C’ such that X1=5*X2 you can do that with the Symbolic Math Toolbox.
actually my matrix a and c has value but my matrix b has variable such matrix a is [1 2;3 5] and matrix c is zeros matrix of (2,1) i want to see the relation between the element of matrix b such as for example 2X1=5X2 and the main equation is a*b=c? is there any command in matlab help me with that?
b = a\c when a and c are both numeric.
However, the special case of a*b = 0 is known as finding the "null space" of a matrix, and finding the "null vectors". You should see the null() routine for that. There are special processes for finding those; the \ command can only come up with one of them, and will usually come up with a 0 vector which is the trivial answer. null() is used to find the general solution for the null space. There are a number of uses for finding the solutions to a*b=0, and it is something to look into specially.

Sign in to comment.

Asked:

on 24 May 2015

Commented:

on 25 May 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!