Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE MATLAB! Use MATLAB! QUESTION 2: [35] A quadratic equation of the following form can be either concave upward or concave downward. When it is
USE MATLAB!
Use MATLAB!
QUESTION 2: [35] A quadratic equation of the following form can be either concave upward or concave downward. When it is concave upward, a local minimum exists. When the quadratic equation is concave downward, a local maximum exists. f(x)= ax? +bx+c Using the principle of differentiation, write a local function quadmaxmin that will print out the local minimum or local maximum of a quadratic equation. The function will accept a vector that consists of the coefficients of a quadratic equation (i.e. [a b c]). The function will also display an error message if the input vector does not represent the coefficients of a quadratic function. Example 1: quadmaxmin([1 2 4]) will return the following: >> the local minimum is: (-1.00, 3.00) Example 2: quadmaxmin([-1 -2 4 0]) will return the following: >> Error: please enter a vector with 3 elements To verify that the above outputs are correct, plot the original quadratic function and observe the critical points (i.e. the local maximum or local minimum). Start with the function header below: function quadmaxmin (x) (write a local function "quadmaxmin.m and test it with Example 1 and Example 2)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