Borrar filtros
Borrar filtros

fminsearch with 3 variables

4 visualizaciones (últimos 30 días)
Jens Petit-jean
Jens Petit-jean el 28 de Feb. de 2021
Comentada: Jens Petit-jean el 28 de Feb. de 2021
Hello,
How do I use fminsearch for a equation with 3 variables?
f(x,y,z)=1-(x-1)^(2) * (y-1.7)^(2) - (y-1.5)^(2) * (z-2.1)^2
I thought something like this :
fun=@(x,y,z) 1-(x-1).^(2).*(y-1.7)^(2)-(y-1.5)^(2)*(z-2.1).^2
fminsearch(fun,[0,0,3]) (with (0,0,3) a random point)
but I always got the message "Not enough input arguments"
Thanks in advance!

Respuesta aceptada

Walter Roberson
Walter Roberson el 28 de Feb. de 2021
example
f=@(v)v(1).*v(2)-sin(v(1)+v(2))
Instead of
f=@(x,y)x.*y-sin(x+y)

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by