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.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
Risposte (1)
James Tursa
il 19 Set 2022
Modificato: James Tursa
il 19 Set 2022
Is this the type of formulae you are being asked to code?
0 Commenti
Vedere anche
Categorie
Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!