Solving two linear equations with two variables

 Respuesta aceptada

Más respuestas (1)

Ali Al-khadher
Ali Al-khadher el 14 de Mzo. de 2019
%{
ax+by=c....equ(1)
dx+ey=f....equ(2)
A=[a b;d e]
B=[c f]
sol=A/B
x=sol(1)
y=sol(2)
example
3x-9y=-42....equ(1)
2x+4y=2......equ(2)
%}
A = [3 -9;2 4]
b = [-42;2]
%Solve Ax=b as A\b
sol=A\b;
x=sol(1)
y=sol(2)

1 comentario

madhan ravi
madhan ravi el 14 de Mzo. de 2019
The equations doesn't correspond to the equations posted by the OP, by the way the correct solution had been answered and accepted 8 years ago.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 27 de Jun. de 2011

Comentada:

el 14 de Mzo. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by