Question

3. Write a Matlab code that uses line search to find the minimum of, f(x)=\frac{x^{2}}{10}-2 \sin x which lies in the interval from L 0 to ry = 4. Use

a tolerance of 10-6 for convergence. Note and report the number of operations (or iterations) the solution makes.Next, use interval reduction to get the minimum. Note the same.Finally, modify your last code so that it's a golden-section search and find the minimum.Compare the number of operations and the time requirement (using tic/toc command) for the threemethods.

Fig: 1

Fig: 2

Fig: 3