- Derive equations A*B = C
- Create symbolic variables, in your case :
Finding unknow of equation
6 ビュー (過去 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!