필터 지우기
필터 지우기

finding root of a three variable function

조회 수: 5 (최근 30일)
Luis Isaac
Luis Isaac 2020년 11월 10일
편집: Stephan 2020년 11월 10일
Dear
I have a function that depends on three variable f(x,y,z) and I would like to find the root of this function near x0,xy0,z0
I tried fzero(f,[x0,y0,z0]) but de not work because the Matlab says "Second argument must be a scalar or vector of length 2"
Is that means that fzero only works for univariate o bivariate functions?
Does exist a build in function to calculate the zeros of a 3D function?
Thanks in advance,

답변 (1개)

Stephan
Stephan 2020년 11월 10일
편집: Stephan 2020년 11월 10일
You can try fsolve:
% example function
% x(1) = x
% x(2) = y
% x(3) = z
fun = @(x) 3*cos(x(1)) - x(2).^1/3 + x(3) - 7
opts = optimoptions('fsolve','Algorithm','Levenberg-Marquardt');
sol = fsolve(fun,[0 0 0],opts)
test = fun(sol)

카테고리

Help CenterFile Exchange에서 Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by