Question

1. The function f(z, y) (a-x)2 + b(y-12)2 is called Rosenbrocks banana function. It is often used as a benchmarking test for optimization algorithms becatse it is easy to find the minimum by hand but often very difficult to find numerically. Throughout the problem, we will use the values a = 2 and b 10. You can plot this function using the following code: x3:0.1:3; y = -10:0.2:10; Cx,Ymeshgrid(x,y); Z(2-X).2 10* (Y-X. 2). 2; surf (X, Y,z) (a) Write a Matlab function that computes f using only one input (i.e. one vari- able). Your input wil need to be a vector of length 2. Use this function to calculate f (1, 10) and save the result in A1.dat. (b) Use fminsearch to find the minimum of f and save it as a 2x 1 column vector [x; yl in the file A2.dat. Use an initial guess of [1; 10]

please solve then upload matlab code

Thanks

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q1.

HOME PLOTS APPS EDITOR PUBLISHH MEW Search Documentation Log In Find Files Compare Print Insert Run Section Go To▼ Comment 96

Q2.

Here the fminsearch function is used and the minimum values are stored in the column vector z.

HOME PLOTS APPS EDITOR PUBLISHH MEW ( Search Documentation Log In Find Files Insert Run Section E, compare dGoTo. Comment & A

Add a comment
Know the answer?
Add Answer to:
please solve then upload matlab code Thanks 1. The function f(z, y) (a-x)2 + b(y-12)2 is...
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