Matlab code for solving the following system equation

2x + y + 5z = 5; 2x + 2y +3z = 7 ; x + 3y + 3z = 6

3 Commenti

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;
I do not understand that remark?

Accedi per commentare.

Risposte (2)

>> 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
Ronish
Ronish il 14 Mag 2024
Solve x=4=6

1 Commento

It seems doubtful that this is the solution -- it does not solve for y or z !

Accedi per commentare.

Categorie

Scopri di più su Mathematics in Centro assistenza e File Exchange

Richiesto:

il 18 Set 2020

Commentato:

il 13 Giu 2024

Community Treasure Hunt

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

Start Hunting!

Translated by