Convert integrand to a function in a loop
3 次查看(过去 30 天)
显示 更早的评论
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
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]
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!