Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB 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

  4. Jan 17, 2009 #3
    The command to evaluate
    \int_a^b f(x) dx

    Code (Text):
  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.

  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)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook