필터 지우기
필터 지우기

Convert integrand to a function in a loop

조회 수: 3 (최근 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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by