vectorizing solution using fzero
Show older comments
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.
Accepted Answer
More Answers (1)
Categories
Find more on Direct Search in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!