Recursively build function handle and then solve

Hello,
I need to build a function handle of n functions such as:
num_desired_functions=n
for i=1:n
fun{i}=@X some function of X(1)...X(n)
end
Now, I need to convert this cell array to a function handle of n functions that I will solve simultaneously with fsolve or lsqnonlin. Any ideas?

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 6 月 12 日

1 投票

F = @(x) cellfun(@(f) f(x), fun) ;

カテゴリ

ヘルプ センター および File ExchangeSystems of Nonlinear Equations についてさらに検索

製品

リリース

R2018b

質問済み:

2020 年 6 月 12 日

回答済み:

2020 年 6 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by