vectorizing solution using fzero
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Direct Search 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!