q = quadl(fun,​a,b,tol,tr​ace,p1,p2,​...)

1 view (last 30 days)
Kazim
Kazim on 3 Mar 2013
Hi Dear Matlab Users;
I want to use quadl function using my function and then integrate it numerically.
Matlab function reference says
quadl(fun,a,b,tol,trace,p1,p2,...) provides for additional arguments p1,p2,... to be passed directly to function fun, fun(x,p1,p2,...)
I tried it just below but it gives me error. What is the problem ? I could not understand.
syms s zeta z1
k=quadl('ahmet',-1,1,[],[],s,zeta,z1)
function out = ahmet(r,s,zeta,z1)
syms z1 s zeta
out=2*r.^2*s.^4*zeta*z1;
end
It gives an error just below
Undefined function 'isfinite' for input arguments of type 'sym'
I want to integrate numerically my function for r variable -1 to 1. The other input arguments want to remain like constant because after integration of r; then I will integrate for s; for zeta; for z1 too by numerically.
I tried my function integration using int() command but it can not be evaluated analytically. I have to use numeric integration. I gave an example just. My function is more complicated to integrate.

Answers (0)

Community Treasure Hunt

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

Start Hunting!