Output of an integral function as a function
Mostrar comentarios más antiguos
Hi all,
Everyone can tell me how to make the output of an integral function as a function, please? I try the following code, but the result is wrong.
>> f0=@(x) x^2;
>> f1=@(x) (x*quad(@(x) f0,0,2));
>> f0(4)
ans =
16 (>>>>> *good result*)
>> f1(4)
Warning: Maximum function count exceeded; singularity likely. > In quad at 106 In @(x)(x*quad(@(x)f0,0,2))
ans =
57.1751 (>>>>>> *bad result*)
Thank you in advance for your help!!!
Tuan
4 comentarios
Walter Roberson
el 15 de Oct. de 2012
Try
f1=@(x) (x*quad(f0,0,2));
Tuan
el 15 de Oct. de 2012
Walter Roberson
el 15 de Oct. de 2012
f0=@(x) x.^2;
Respuestas (0)
Categorías
Más información sobre Numerical Integration and Differentiation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!