Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Marlab question If a second order polynomial is written in the general form: ax^2 + bx + c = 0 then the roots (i.e. the

image text in transcribedMarlab question
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 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 mfile 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 RootCondition 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 squareroot is less than 0) 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago

Question

(4) What is the difference between the two and why?

Answered: 1 week ago

Question

(12) What gaps are there in the current approach to development?

Answered: 1 week ago