Matlab code for solving the following system equation

57 vues (au cours des 30 derniers jours)
Abi Ak
Abi Ak le 18 Sep 2020
2x + y + 5z = 5; 2x + 2y +3z = 7 ; x + 3y + 3z = 6
  1 commentaire
Igor Arkhandeev
Igor Arkhandeev le 18 Sep 2020
Modifié(e) : Igor Arkhandeev le 18 Sep 2020
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;

Connectez-vous pour commenter.

Réponses (1)

Stephan
Stephan le 18 Sep 2020
>> 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

Catégories

En savoir plus sur Power and Energy Systems dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by