Question: MATLAB Question, please help TER2 Write a function M-file to solve min f(x) by the exact gradient descent method, where f(x) = 5xAX and A
MATLAB Question, please help
TER2 Write a function M-file to solve min f(x) by the exact gradient descent method, where f(x) = 5x"AX and A is one of the following SPD matrices [92] [218] [41 181 2 6 8 9 18 14 (This is a strictly convex problem, the minimizer is r* = 0 and the minimum is 0.) The first line of your M-file should read function [x,min, err,iter) = ExactGradient_ (x0, tol,N,A) The sub-functions that compute the gradient descent direction and f(x + a) are as follows. function p=GD (x) p=-A*x; end function y=f(x,p, alpha) z=x+alpha*p; y=.5*Z'*A*2; end Use the initial guess x0 and set N to be 200 and the tolerance to be 10-10 in your computations. TER2 Write a function M-file to solve min f(x) by the exact gradient descent method, where f(x) = 5x"AX and A is one of the following SPD matrices [92] [218] [41 181 2 6 8 9 18 14 (This is a strictly convex problem, the minimizer is r* = 0 and the minimum is 0.) The first line of your M-file should read function [x,min, err,iter) = ExactGradient_ (x0, tol,N,A) The sub-functions that compute the gradient descent direction and f(x + a) are as follows. function p=GD (x) p=-A*x; end function y=f(x,p, alpha) z=x+alpha*p; y=.5*Z'*A*2; end Use the initial guess x0 and set N to be 200 and the tolerance to be 10-10 in your computations