fminsearch with 3 variables

조회 수: 5 (최근 30일)
Jens Petit-jean
Jens Petit-jean 2021년 2월 28일
댓글: Jens Petit-jean 2021년 2월 28일
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!

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 28일
example
f=@(v)v(1).*v(2)-sin(v(1)+v(2))
Instead of
f=@(x,y)x.*y-sin(x+y)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by