how to solve the below equations

9 views (last 30 days)
RAJAN PRASAD
RAJAN PRASAD on 1 Jun 2016
Answered: Walter Roberson on 1 Jun 2016
a = [1 2;4 5]
b=[6 7;9 8]
c=[6 5;3 4]
d=[7 4;8 0]
e=[1 5;6 7]
f=[3 2;8 9]
A=[1 5;6 7]
B=[3 2;8 9]
A=a*x+b*y
B=c*x-d*y
I want to know x and y

Answers (1)

Walter Roberson
Walter Roberson on 1 Jun 2016
x = sym('x%d%d', [2 2]);
y = sym('y%d%d', [2 2]);
sol = solve([A==a*x+b*y, B==c*x-d*y]);
Xsol = [sol.x11, sol.x12; sol.x21, sol.x22]);
Ysol = [sol.y11, sol.y12; sol.y21, sol.y22]);

Products

Community Treasure Hunt

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

Start Hunting!