Minimize non linear function with undefined vector
Afficher commentaires plus anciens

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?
Réponse acceptée
Plus de réponses (1)
Bruno Luong
le 9 Nov 2018
Modifié(e) : Bruno Luong
le 9 Nov 2018
I'll save you some headache: the solutions are clearly
x = ones(n,1);
1 commentaire
Nolwen Brosson
le 9 Nov 2018
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!