write a matlab command to find th roots of: ax^2+bx+c=0
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ammaa AlSada
il 13 Gen 2019
Commentato: Walter Roberson
il 15 Apr 2022
write a MATLAB commads to find the roots of : ax^2+bx+c=0 , where a,b and c are constants?
0 Commenti
Risposta accettata
jahanzaib ahmad
il 13 Gen 2019
Modificato: madhan ravi
il 15 Gen 2019
a=1;
b=2;
c=3;
x1 = -b +(sqrt((b^2)-(4ac)/(2a))x;
x2=-b-(sqrt((b^2)-(4ac)/(2a));
disp(x1);
disp(x2);
1 Commento
jahanzaib ahmad
il 14 Gen 2019
Modificato: madhan ravi
il 15 Gen 2019
a=1;
b=2;
c=3;
x1 = -b +(sqrt((b.^2)-(4.*a.*c)))/(2.*a);
x2=-b -(sqrt((b.^2)-(4.*a.*c)))/(2.*a);
disp(x1);
disp(x2);
Più risposte (2)
madhan ravi
il 14 Gen 2019
Modificato: madhan ravi
il 14 Gen 2019
help roots
doc roots
help poly2sym
doc poly2sym
0 Commenti
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!