Minimize non linear function with undefined vector
Mostra commenti meno recenti

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?
Risposta accettata
Più risposte (1)
Bruno Luong
il 9 Nov 2018
Modificato: Bruno Luong
il 9 Nov 2018
I'll save you some headache: the solutions are clearly
x = ones(n,1);
1 Commento
Nolwen Brosson
il 9 Nov 2018
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!