finding root of a three variable function

4 visualizaciones (últimos 30 días)
Luis Isaac
Luis Isaac el 10 de Nov. de 2020
Editada: Stephan el 10 de Nov. de 2020
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,

Respuestas (1)

Stephan
Stephan el 10 de Nov. de 2020
Editada: Stephan el 10 de Nov. de 2020
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)

Categorías

Más información sobre MATLAB 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