
Matlab function file
hey i've got the following question and not sure how to do part (b) of it.
consider the functions
f(x)=x^{2}3x+1 and
g(x)=(1+x)sin(2x)
(a) write a MATLAB program to plot the graphs of f(x) and g(x) for 2<=x<=3 together in the same figure.
(b) Given that the function y(x)=f(x)g(x) has only one local minimum point, denoted by(xmin, ymin), on the intercal 2<=x<=3, write
i) a function Mfile (cakked func.m) and
ii) a MATLAB program (using the fminbnd comand) that together will compute xmin and ymin
i've got this for part (a)
Code:
clear
x=2:0.0001:3;
f=((x.^2)(3*x)+1);
g=((1+x).*sin(2.*x));
plot(x,f,x,g,'');
legend('f(x)','g(x)')
not sure how to go about for part (b) both sections
any help will be much appriciated
thanks