Azzera filtri
Azzera filtri

how do i solve a system of 5 equations

13 visualizzazioni (ultimi 30 giorni)
Hi everyone
i am having problems solving for the following
y1=((2.117)*a+2*b-1691.45);
y2=((2.8235)*a-4*b-1935.22);
y3=(c+608.11-366.21-(0.666)*b+(0.7058)*a);
y4=(d+211.43-(0.33)*b-(0.5294)*a);
y5=(e-608.11-153.91-(0.666)*b-(0.4705)*a);
i have tried using the solve command in the toolbox but it keeps returning a as an undefined variable. a is an unknown and i need to solve for it and b c d e .
Any help would be appreciated !
Thanks !
  1 Commento
bassam bitar
bassam bitar il 19 Lug 2015
Modificato: Walter Roberson il 19 Lug 2015
so this is the code i have so far but the answers are way off
syms a b c d e
equ1= (2.117)*a+2*b-1691.45 == 0;
equ2= (2.8235)*a-4*b-1935.22 == 0;
equ3= c+608.11-366.21-(0.666)*b+(0.7058)*a == 0;
equ4= d+211.43-(0.33)*b-(0.5294)*a == 0;
equ5= e-608.11-153.91-(0.666)*b-(0.4705)*a ==0;
sol=solve([equ1,equ2,equ3,equ4,equ5],a,b,c,d,e);
aSol = sol.a
bSol = sol.b
cSol = sol.c
dSol = sol.d
eSol = sol.e

Accedi per commentare.

Risposta accettata

Star Strider
Star Strider il 19 Lug 2015
Modificato: Star Strider il 19 Lug 2015
You have to declare the symbolic variables first.
This works:
syms a b c d e
y1=((2.117)*a+2*b-1691.45);
y2=((2.8235)*a-4*b-1935.22);
y3=(c+608.11-366.21-(0.666)*b+(0.7058)*a);
y4=(d+211.43-(0.33)*b-(0.5294)*a);
y5=(e-608.11-153.91-(0.666)*b-(0.4705)*a);
[a,b,c,d,e] = solve(y1, y2, y3, y4, y5, [a,b,c,d,e]);
a = 753.54
b = 48.101
c = -741.71
d = 203.37
e = 1148.6
EDIT — Added solved variables
  4 Commenti
madhan ravi
madhan ravi il 17 Ott 2018
Accepted answer by Madhan Ravi since the OP didn't
Star Strider
Star Strider il 17 Ott 2018
@madhan ravi —
Thank you!

Accedi per commentare.

Più risposte (1)

Muhammad Usman Saleem
Muhammad Usman Saleem il 19 Lug 2015

Community Treasure Hunt

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

Start Hunting!

Translated by