필터 지우기
필터 지우기

Recursively build function handle and then solve

조회 수: 4 (최근 30일)
Daria Nikitaeva
Daria Nikitaeva 2020년 6월 12일
답변: Walter Roberson 2020년 6월 12일
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일
F = @(x) cellfun(@(f) f(x), fun) ;

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by