Effacer les filtres
Effacer les filtres

finding root of a three variable function

5 vues (au cours des 30 derniers jours)
Luis Isaac
Luis Isaac le 10 Nov 2020
Modifié(e) : Stephan le 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,

Réponses (1)

Stephan
Stephan le 10 Nov 2020
Modifié(e) : Stephan le 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)

Catégories

En savoir plus sur Optimization dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by