Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started