Question: Write a MATLAB function that attempts to locate the maximum and minimum values of an arbitrary function, f(x), over a certain range. The function being
Write a MATLAB function that attempts to locate the maximum and minimum values of an arbitrary function, f(x), over a certain range. The function being evaluated should be passed to the function as a calling argument. Be sure to check that there are a valid number of input arguments and that the MATLAB "help" & "lookfor" commands are properly supported.
The function should have the following input arguments:
first_valueThe first value of x to search
last_valueThe last value of x to search
num_stepsThe number of steps to include in the search
funcThe name of the function to search
The function should have the following output arguments:
xminThe value of x at which the minimum was found
min_valueThe minimum value of found
xmaxThe value of x at which the maximum was found
max_valueThe maximum value found
(If you could please correctly code this hw problem & I will rate, thanks!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
