Question: Create a function that solves a quadratic equation. The first line of your function should be: function [ x 1 , x 2 ] =
Create a function that solves a quadratic equation. The first line of your function should be:
function xxquadraticsolverabc
The inputs are a b and c which must return all solutions such that axbxc Use
conditional statements for the following cases:
If a and b are both equal to zero, then no solution exists.
Otherwise, if a is zero, the problem becomes linear and there is only one solution.
If solution is complex, assume no solution and inform the user.
If a double root exists, return same solution twice and inform the user.
Otherwise, return both solutions.
In any cases where there is no solution, return x and x with an error message. If there
is only one solution, set both x and x to this solution.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
