- Derive equations A*B = C
- Create symbolic variables, in your case :
Finding unknow of equation
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Abderrahim. B
2022년 11월 16일
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
John D'Errico
2022년 11월 16일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!