# Definite Integral in Matlab

1. ## matlab integral

Hi

Could some one please tell me how to calculate the definite integral in MATLAB?

Thanks

•

•

3. ## matlab definite integral

I have found double(int(...)) really useful, but thanks.

This one is also good:

http://www.math.duke.edu/education/c.../mlabtut9.html

•

4. ## integral en matlab

for example to compute :

int(sin(2*x),0,pi/2) or int(sin(2*x),x,0,pi/2)
will compute sin2x integral on the interval of [0 pi]

or you can have integral of a function e.g:

write an M-file function myfun that computes the integrand:
function y = myfun(x)
y = 1./(x.^3-2*x-5);
Then pass @myfun, a function handle to myfun, to quad, along with the limits of integration, 0 to 2:

Q =

-0.4605
Alternatively, you can pass the integrand to quad as an anonymous function handle F:
F = @(x)1./(x.^3-2*x-5);

by the way you can have all these by matlab help.it is so easy just open matlab help and use search tab. [/img]

5. ## definite integral matlab

Hi

Example : y = exp ( x^2 ) ; interval [10 20]

syms x
int ( exp ( x^2 ) , 10 , 20 )

Hope I've helped !!

1 members found this post helpful.

•

6. ## definite integral in matlab

it gives an error that int does not work with class double. how to solve that problem?

--[[ ]]--