Question: Problem Description If a second order polynomial is written in the general form: ax^2 + bx + c = 0 then the roots (i.e. the
Problem Description If 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 squreroot b^2 - 4ac/2a The test suite workspace includes a vector variable abo 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 mile to do the following: Check if the roots are real and distinct. Note that the roots will be real if the value under the square root is greater than or equal to zero. They will not be distinct, however, if the value under the square root 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 (i.e. complex because the value under the square root is less than 0) 2. In cases where there are two real and distinct roots, compute the two roots and assign them in ascending order to a two dement 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. Solution 03 MATIAB Documentation Enter the commands to your script here, Be sure to assign values to the exact variable names give
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
