>> lookfor integral
...
QUAD Numerically evaluate integral, adaptive Simpson quadrature.
QUAD8 Numerically evaluate integral, higher order method.
QUADL Numerically evaluate integral, adaptive Lobatto quadrature.
...
Hope this helps.
Greg
Hi, do you want to integrate symbolically? If you have the Symbolic Toolbox, you can do the following:
syms x y
y = x^2;
z=int(y)
The above gives the antiderivative with the constant of integration equal to zero.
% Now plot the derivative and antiderivative
ezplot(y,[-5 5]); hold on;
h = ezplot(z,[-5 5]);
set(h,'linewidth',2,'color',[1 0 0 ]);
title('x^2 and x^3/3');
Hope that helps,
Wayne
Consider the integral as an ODE for g (as a special case where the RHS
does not depend on g).
Then use a standard ODE solver with odefun=f(t) and initial condition
g(t0)=0.
For example:
f=@(t,y) t.^2.*exp(-t);
[t,g] = ode45(f,[0,10],0);
plot(t,g);
Good luck,
Pete