matrix and system equation
7 次查看(过去 30 天)
显示 更早的评论
Can I convert matrix to system equation?If I want to input matrix A=[4 -4 0;2 3 5;3 5 7] X=[x1;x2;x3] B=[4;5;6]
0 个评论
回答(2 个)
Ameer Hamza
2020-9-30
编辑:Ameer Hamza
2020-9-30
If you have the symbolic toolbox, then do it like this
A=[4 -4 0;2 3 5;3 5 7]; B=[4;5;6];
syms x [3 1]
eqs = A*x == B;
Result
>> eqs
eqs =
4*x1 - 4*x2 == 4
2*x1 + 3*x2 + 5*x3 == 5
3*x1 + 5*x2 + 7*x3 == 6
and If you just want to find the solution of x, then run
x = A\B;
Result
>> x
x =
-0.2000
-1.2000
1.8000
7 个评论
Ameer Hamza
2020-9-30
编辑:Ameer Hamza
2020-9-30
There should be a space between variable name and size
syms x [q,1]
also, the recommended functional-based syntax is
x = sym('x', [3 1])
Th
2020-9-30
1 个评论
John D'Errico
2020-9-30
Please don't use an answer to make a comment. Use comments for that purpose.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Number Theory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!