Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Solve all the equtn using script:

How to use Script?

Click on that icon.

Solving Quadratic Equations in MATLAB


1. quadratic equation

x 27 x+12=0

toh isse MATLAB me kese likhnge we will write


a= x^2-7*x+12=0;
s=solve(a);
disp(the first root is : ), disp(s(1));
disp(the second root is: ) disp(s(2));

I hope you r aware of roots koi bhi hum equtn solve krte hai den humare pass do
value ati hai like above eqn ko phele notebook me solve krna den MATLAB
me. Kk
Solving Hig her Order Equations in MATLAB
2
2. equtn : ( x3 ) ( x 7 )=0

solve(above eqn ko likho jese MATLAB me likhte hai)


4
3
2
3. fourth order equation x 7 x +3 x 5 x + 9=0

Same method jese 1que kiys hai try kro


Now next thing suppose me chati hu ki roots ko me double me convert kru then
Like exple1: mene disp tak likh diya den me likhungi
disp('Numeric value of first root'), disp(double(s(1)));
disp('Numeric value of second root'), disp(double(s(2)));
disp('Numeric value of third root'), disp(double(s(3)));
disp('Numeric value of fourth root'), disp(double(s(4)));
Solving System of Equations in MATLAB
Let us solve the equations:
5x + 9y = 5
3x 6y = 4
Humne kya krna hai phele ek variable me dono equn likh deni hai as shown
below
s = solve('5*x + 9*y = 5','3*x - 6*y = 4');
s.x
s.y

den ek bar s variable me jo equtn hai use x ke liye solve rkna hai ek bar y
variable ke liye
solve this
x + 3y -2z = 5
3x + 5y + 6z = 7
2x + 4y + 3z = 8

You might also like