Write a function file that computes the roots of a quadratic using the form for x+ and x−1 that are least susceptible to cancellation error.
2 ビュー (過去 30 日間)
古いコメントを表示
Write a function file that computes the roots of a quadratic using the form for x+ and x−1 that are least susceptible to cancellation error. Also write a script file to find the roots of
ax2 +bx+c=0
For reference, your function file will have the structure
function [xp,xm] = quadform(a,b,c)
if (b<0)
xp =
xm = else
xm =
xp = end
Calculate the roots for the following
a) a = 1;b = −105;c = 1.
回答 (1 件)
James Tursa
2022 年 9 月 19 日
編集済み: James Tursa
2022 年 9 月 19 日
Is this the type of formulae you are being asked to code?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!