vectorizing solution using fzero
Afficher commentaires plus anciens
i have equations of the form f(x,X)=0; where X is a column vector of size N. i can solve using for example
f = @(xx) ( f(xx, X))
for i = 1:N
sol(i) = fzero( f(X(i)), [ 0 , 1000])
end
How I would like to eliminate the for loop. Is there a way? I would like something like sol = fzero(f(X), [0,1000]), however it gives an error if I try this. Thanks in advance.
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Direct Search dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!