1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Computing the area under a curve with Matlab

  1. Jan 17, 2009 #1
    how to find the area under the curve by using matlab
    i mean to say what is the command for this
     
  2. jcsd
  3. Jan 17, 2009 #2
    Re: difficult integral.....

    please if any body know about it then please reply me soon
    i am worried

    Thanks
     
  4. Jan 17, 2009 #3
    The command to evaluate
    [itex]
    \int_a^b f(x) dx
    [/itex]
    is

    Code (Text):
    quad(f(x),a,b)
     
  5. Jan 18, 2009 #4
    Thanks alot

    I shall check it.
     
  6. Jan 18, 2009 #5
    Hi qntty

    hw r u?

    thnx for the reply about my problem
    in the previous problem i am actually confused between "quad" and "quad1" command
    and is the f(x) is y=f(x)? i mean to say the function that relate the y and x.

    Do you if there is some data values in excel then how
    can we plot these values in matlab.

    thnx
     
  7. Jan 18, 2009 #6
    Hi Faiza,

    If you have only few point of your curve, than you may use two ways:
    1. Find approximation polynomial and than evaluate integral;
    2. Just use following formula (by integral definition):
    [tex]\sum_{i=1}^{n-1} f_i(x_{i+1}-x_i) , where f_i=f(x_i)[/tex]

    There are some other methods you may find in the Internet.

    Note: Both methods gives not exact solutions. For exact solution you have to know f(x)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Computing the area under a curve with Matlab
Loading...