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 (최근 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!