MATLAB.2 Minimization To find where a function attains its minimum on an interval we use the fmin command. example First we make a M-file. ************************************************* function w= f(x) w=exp(-x^2+2*x) -.5; ************************************************* To find where f attains its minimum on [-1,3] go to the command window and type: ************************************************ xm=fmin('f(x)',-1,3) ************************************************ To find the minimum value type: *********************************************** f(xm) *********************************************** NOTE f(x) maximizes where -f(x) minimizes.To find the maximum value of f(x) on [-1,3] type: *********************************************** xM=fmin('-f(x)',-1,3); f(xM) ******************************************** To find the maximum of abs(f(x)) on [-1,3] type: ************************************************** xM=fmin('-abs(f(x))',-1,3); abs(f(xM)) ************************************************* ASSIGNMENT 2 : Let h(x)=x^3-6*x^2+x . Graph h(x) on [-1,5] . Find where h(x) maximizes on [-1,5] and its maximum value. Find where h(x) minimizes on [-1,5] and its minimum value.