integrating area under a curve

  • Follow


I have a bunch of data that I plot and I need to integrate a specific area under the curve.  The function trapz is great, but I would like to just integrate under a specific peak.  Can Matlab tell me the exact x and y ranges for particular peaks?
0
Reply Tara 1/27/2011 8:39:03 AM

"Tara" wrote in message <ihrav7$c8f$1@fred.mathworks.com>...
> I have a bunch of data that I plot and I need to integrate a specific area under the curve.  The function trapz is great, but I would like to just integrate under a specific peak.  Can Matlab tell me the exact x and y ranges for particular peaks?

Let me ask it differently: I know the x values that I want, corresponding to the peak (say from 6-8): (startindex=find(x==6); endindex=find(x==8); then desiredx=x(startindex:endindex); 

But now I need the corresponding y values so that I can use the trapz function.  Thanks!
0
Reply Tara 1/27/2011 9:46:03 AM


"Tara" wrote in message <ihrav7$c8f$1@fred.mathworks.com>...
> I have a bunch of data that I plot and I need to integrate a specific area under the curve.  The function trapz is great, but I would like to just integrate under a specific peak.  Can Matlab tell me the exact x and y ranges for particular peaks?

Dear Tara,

          I have the same problem in Simulink Model. I have a digital signal and I would like to find out the area under the curves and I want to know the peak values.

         Is there any way to find out?

         It will be very useful for me.

Prashant

    
0
Reply sandhi.prashant (130) 10/28/2011 6:17:15 AM

2 Replies
379 Views

(page loaded in 0.04 seconds)

Similiar Articles:













7/11/2012 4:09:21 PM


Reply: