Question
Numerical method. im more interested in point c.
EE2E11-1 1. We require to find the values of (,y), which minimise the following function )12242.5-45ry+82-12+25 (a) Describe
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

Add a comment
Know the answer?
Add Answer to:
EE2E11-1 1. We require to find the values of (,y), which minimise the following function )12242.5...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT