write a matlab command to find th roots of: ax^2+bx+c=0
16 次查看(过去 30 天)
显示 更早的评论
write a MATLAB commads to find the roots of : ax^2+bx+c=0 , where a,b and c are constants?
0 个评论
采纳的回答
jahanzaib ahmad
2019-1-13
编辑:madhan ravi
2019-1-15
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 个评论
jahanzaib ahmad
2019-1-14
编辑:madhan ravi
2019-1-15
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);
更多回答(2 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!