Minimize non linear function with undefined vector
Show older comments

I have to do the picture's question.
I already built a function for the function to minimize:
function z=f(x)
n = size(x,2);
z = symsum(100(x(1,i)-x(1,i-1).^2).^2 + ...
(1-x(1,i-1))^2,i, 2, n);
end
Now, I want to use the fminunc matlab function to finish the exercise. However, I have several questions:
1) I don't know where I can mention that x is the 2d vector, then 10, 100, 1000? 2) As there is no specifications about x0, I don't know how to say that I want to start from - infinite.
Any ideas?
Accepted Answer
More Answers (1)
Bruno Luong
on 9 Nov 2018
Edited: Bruno Luong
on 9 Nov 2018
I'll save you some headache: the solutions are clearly
x = ones(n,1);
1 Comment
Nolwen Brosson
on 9 Nov 2018
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!