Answer:
The MATLAB snippet is as follows, and assumes that the slope function, which returns the required derivatives, is given:
CODE:
%% Inputs
x_0 = 0; % current estimate for x-coordinate
y_0 = 0; % current estimate for y-coordinate
x = [x_0]; % array which will hold all x-estimates
y = [y_0]; % array which will hold all y-estimates
h = 0.01; % arbitrary step value assumed
%% Gradient Descent Snippet
for i = 1:5 % Loop for doing 5 iterations
[d1, d2] = slope(x(i),y(i)); %calculate derivatives required
x_temp = x(i) - h*d1; % perform gradient step in x-direction
y_temp = y(i) - h*d2; % perform gradient step in y-direction
x = [x x_temp]; % update array holding x-estimates
y = [y y_temp]; % update array holding y-estimates
end
EE2E11-1 1. We require to find the values of (,y), which minimise the following function )12242.5...