Filter löschen
Filter löschen

Convert integrand to a function in a loop

3 Ansichten (letzte 30 Tage)
AH2019
AH2019 am 15 Apr. 2019
Beantwortet: madhan ravi am 15 Apr. 2019
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 Kommentare
madhan ravi
madhan ravi am 15 Apr. 2019
Bearbeitet: madhan ravi am 15 Apr. 2019
If you mean converting symfun to function handle , you may be interested in matlabFunction(). [comment moved to answer]
AH2019
AH2019 am 15 Apr. 2019
Thanks ravi

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

madhan ravi
madhan ravi am 15 Apr. 2019

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by