Convert integrand to a function in a loop

1 回表示 (過去 30 日間)
AH2019
AH2019 2019 年 4 月 15 日
回答済み: madhan ravi 2019 年 4 月 15 日
Please consider following code.
syms r
f= sym('f',[1,5]);
ANS = zeros(1,5);
for q=1:5
f(q) = sin(r^q)/r
ANS(q) = integral(f(q) ,pi/2 ,pi ,'ArrayValued' , 1)
end
Please hint me to convert integrand to function handle.
In general, f is a too large expression rather than "sin(r^q)/r".
Thank you taking your time
  2 件のコメント
madhan ravi
madhan ravi 2019 年 4 月 15 日
編集済み: madhan ravi 2019 年 4 月 15 日
If you mean converting symfun to function handle , you may be interested in matlabFunction(). [comment moved to answer]
AH2019
AH2019 2019 年 4 月 15 日
Thanks ravi

サインインしてコメントする。

採用された回答

madhan ravi
madhan ravi 2019 年 4 月 15 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by