Mathematical Computations – MATLAB for Beginners – MATLAB Basics – Tutorials – Volume-2

Unit-11

Algebraic Equations

>> syms x y;

[x,y] = solve(x^2 + x*y + y == 3,x^2 - 4*x + 3 == 0)
 
x =
 1
 3
 

y =
     1
 -3/2

>> syms x y z
>> eqn1=3*x+2*y+6*z==0
eqn1 =
3*x+2*y+6*z=0


>> eqn2=27*x+48*y+6*z==6
eqn2 =
27*x+48*y+6*z=6


>> eqn3=63*x+22*y+43*z==18
eqn3 =
63*x+22*y+43*z=18

>> result=solve(eqn1,eqn2,eqn3)
result = 
    x: [1x1 sym]
    y: [1x1 sym]
    z: [1x1 sym]

>> result.x
ans =
34/75
 >> result.y
 ans =
 -61/575

 >> result.z
 ans =
 -22/115

Be the first to comment

Leave a Reply

Your email address will not be published.




seventeen + twenty =