Question: It a second order polynomial is written in the general form ax^2 + bx + c = 0 then the roots (i.e the values of

 It a second order polynomial is written in the general form

It a second order polynomial is written in the general form ax^2 + bx + c = 0 then the roots (i.e the values of x that satisfy the equation) can be determined using the quadratic formula: x = -b plusminus Squareroot b^2 - 4ac/2a the test suite workspace includes a vector variable abc that is a 3 element row vector with values for a, b, and c in the first, second, and third column respectively. Write a script m file to do the following: Check if the roots are real and distinct. Note that the roots will be real if the value under the squareroot is greater than or equal to zero. They will not be distinct, however, if the value under the squareroot is exactly equal to zero, Create an integer variable Root condition and assign it a value as follows: the value 2 if the roots are real and distinct The value 1 if the two roots are the same The value 0 if the roots are not real complex because the value under the squareroot is less than o) in cases where there are two real and distinct roots compute the two roots and assign them in ascending order to a two element row vector x_ solution. In cases where the two roots are the same, solve for the root and assign to a scalar variable x_ solution. Do not create the variable x _solution if the roots are complex

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!