Define a function_handle with array of variable dimension as an input
Mostrar comentarios más antiguos
Hi everybody,
I've a probleme of unconstrained optimization and I would like to define the following function as a function_handle such that dimension is variable, for example:

where
I wonder if it's possible or there is a another way to define F.
Thank You in advance for Your Help
Respuestas (1)
Walter Roberson
el 10 de En. de 2023
F = @(x) sum((10*(x(1:2:end) - x(2:2:end)) + (x(1:2:end)-1)).^2)
1 comentario
Lorenzo
el 11 de En. de 2023
Categorías
Más información sobre Surrogate Optimization 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!