finding root of a three variable function

6 visualizzazioni (ultimi 30 giorni)
Luis Isaac
Luis Isaac il 10 Nov 2020
Modificato: Stephan il 10 Nov 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,

Risposte (1)

Stephan
Stephan il 10 Nov 2020
Modificato: Stephan il 10 Nov 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)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by