---
+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Advanced Member level 3
    Points: 6,635, Level: 19
    Sadegh.j's Avatar
    Join Date
    Nov 2006
    Posts
    754
    Helped
    47 / 47
    Points
    6,635
    Level
    19

    matlab integral

    Hi

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

    Thanks

    •   Alt11th November 2008, 02:49

      advertising

        
       

  2. #2
    Advanced Member level 3
    Points: 13,776, Level: 28

    Join Date
    Feb 2002
    Posts
    750
    Helped
    95 / 95
    Points
    13,776
    Level
    28



    •   Alt12th November 2008, 00:09

      advertising

        
       

  3. #3
    Advanced Member level 3
    Points: 6,635, Level: 19
    Sadegh.j's Avatar
    Join Date
    Nov 2006
    Posts
    754
    Helped
    47 / 47
    Points
    6,635
    Level
    19

    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



    •   Alt12th November 2008, 04:50

      advertising

        
       

  4. #4
    Member level 1
    Points: 1,302, Level: 8

    Join Date
    Dec 2008
    Posts
    32
    Helped
    0 / 0
    Points
    1,302
    Level
    8

    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 = quad(@myfun,0,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);
    Q = quad(F,0,2);


    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. #5
    Junior Member level 2
    Points: 1,093, Level: 7
    OMID-313's Avatar
    Join Date
    Dec 2008
    Location
    Solar System
    Posts
    24
    Helped
    2 / 2
    Points
    1,093
    Level
    7

    definite integral matlab

    Hi

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

    Answer :

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

    Hope I've helped !!


    1 members found this post helpful.

  6. #6
    Member level 5
    Points: 1,209, Level: 7
    ahsaan's Avatar
    Join Date
    Apr 2009
    Location
    Pakistan
    Posts
    81
    Helped
    14 / 14
    Points
    1,209
    Level
    7

    definite integral in matlab

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



+ Post New Thread
Please login