Matlab code for solving the following system equation

63 次查看(过去 30 天)
2x + y + 5z = 5; 2x + 2y +3z = 7 ; x + 3y + 3z = 6
  1 个评论
Igor Arkhandeev
Igor Arkhandeev 2020-9-18
编辑:Igor Arkhandeev 2020-9-18
You should create two matrices:
A = [2, 1, 5; 2, 2, 3; 1, 3, 3];
B = [5;7;6];
Next a lot of ways to solve it. The most easiest:
x=inv(A)*B;
or
x = A\B;

请先登录,再进行评论。

回答(1 个)

Stephan
Stephan 2020-9-18
>> A = [2 1 5; 2 2 3; 1 3 3]
A =
2 1 5
2 2 3
1 3 3
>> b = [5; 7; 6]
b =
5
7
6
>> sol = A\b
sol =
2.4545
1.4545
-0.2727
>> test = A*sol
test =
5
7
6

类别

Help CenterFile Exchange 中查找有关 Power and Energy Systems 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by