Minimize non linear function with undefined vector
Mostrar comentarios más antiguos

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?
Respuesta aceptada
Más respuestas (1)
Bruno Luong
el 9 de Nov. de 2018
Editada: Bruno Luong
el 9 de Nov. de 2018
I'll save you some headache: the solutions are clearly
x = ones(n,1);
1 comentario
Nolwen Brosson
el 9 de Nov. de 2018
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!