- Derive equations A*B = C
- Create symbolic variables, in your case :
Finding unknow of equation
6 views (last 30 days)
Show older comments
I have a A= 6*6 matrices with all known value, B=[0;0;x;0;0;y] and C=[a;b;0;c;d;-2000] and the relation is A*B=C. How can i get the unknown values of B &C?
0 Comments
Answers (2)
Abderrahim. B
on 16 Nov 2022
Hi!
Matrix A is also unknown for us ^^ !
Workflow to find the unknowns is as follow:
syms x y a b c d
3. Declare the system of equations.
4. Solve System of Linear Equations Using solve
Hope this helps
0 Comments
John D'Errico
on 16 Nov 2022
I'll use syms here, because it displays things nicely.
syms x y a b c d
B=[0;0;x;0;0;y]
C=[a;b;0;c;d;-2000]
So B and C are VECTORS, not matrices. Now you have a matrix A, that is 6x6, and is completely known. As long as A is entirely known and is of full rank, you can use any number of ways to solve the problem.
For example, you could just use solve. But solve will often be slow. It is trivial to accomplish though. As an example, I need to have the matrix A, in numerical form.
A = randi(9,[6,6])
And now the solution using solve, for this particular matrix:
sol = solve(A*B == C,[a,b,c,d,x,y])
As easy, we can use equationsToMatrix to write the probmel in terms of linear algebra.
[S,T] = equationsToMatrix(A*B == C,[a,b,c,d,x,y])
So, for that particular matrix A, we now have two matrices, S and T that represnet the linear system. SOlve them, using backslash.
abcdxy = double(S)\double(T)
As you can see with format rat, the solution is the same.
format rat
abcdxy
Could we have done it differently yet? Yes. Move the unknowns to the left hand side, and move everything known to the right hand side. You will still have a system of linear equations. The result will be the same.
0 Comments
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!