Assume that the function y(x) = f (x) + g(x) has a single local minimum in the interval 0 <= x <= 1, at x = xm. Write (i) a function M-file (called funct.m) and (ii) a MATLAB statement (using the fminbnd command) that together will compute xm and the value of y at xm.
The Answer to the Question
is below this banner.
Can't find a solution anywhere?
NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?
Get the Answers Now!You will get a detailed answer to your question or assignment in the shortest time possible.
Here's the Solution to this Question
i)
Matlab function code('func.m'):
function fun = func (x)
g=@(x) 2^{*} x+1 ;
end
ii) Main Program:
fprintf('The zero of the function is, c=% 4.2f \n', c);
Output: