Question: 1 . Sketch a flowchart and write a MATLAB function to solve Exercise 4 . 6 of your MATLAB textbook. [ Hint: see MATLAB Control
Sketch a flowchart and write a MATLAB function to solve Exercise of your MATLAB textbook. Hint: see MATLAB Control Structures Part II lecture Add a copypicture of your flowchart here.
Exercise
A function takes three numeric arguments representing the coefficients of a quadratic equation and returns two values, which are the two roots of the equation. The name of the function is quadRoots.
Write a suitable prototype or definition for the function. Add an appropriate help and usage section at the top of the function, and save it in a suitably named file.
Add a test to check if the quadratic roots are complex and to return
with an error if this is true see Section doc error or help error
Complete the function quadRoots and test that it gives the correct results.
Modify the quadRoots function so that it accepts a single array containing all three coefficients and returns a single array containing the roots.
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
