Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to compute area under a curve using Matlab???

Status
Not open for further replies.

Luckybuilding

Member level 1
Joined
Oct 8, 2005
Messages
40
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,615
matlab area under curve

Hi, all
This may make you laughing. But, I don't know how to compute area under a curve using Matlab having only (x,y) values of the curve?

(Not having the function of equation)


please, guide me.

Thanks
 

area under curve matlab

This is just a shot in the dark, but if you can find the equation from the points then you simply need to integrate right?

This site explains how to use the curve fitting tool.

**broken link removed**

I've never done this before, but I hope this helps
 
area under the curve matlab

hi,
if u have x,y values then u should integrate let y=f(x)

where z=area under curve=integration of y with respect to x=int[x0,xf] of (f(x))dx how to integrate u take a slice of f(x) and move it along x-axis which in ur case is simply the smallest step between to values of the x,y values so u just add the y values but u have to have very small step between two successive points in order to apprximate each point as a slice.
 
area under curve in matlab

Since (x,y) values are availabel ,use any of the numerical techniques like simpsons method or trapezoidal rule etc. for integration.
 
matlab area under a curve

If you want a rough aproximation simpsons, newton
or trapeziodal should be enough. If you want
aproximation by curves using Lagrange Polynomials
or Spline should also be enough.
see: Chapra/Canale, Numerical Methods for Engineers
or Al-Khafaji/Tooley. Numerical method for engieers
or Shiavi,R. Applied Statistical Signal Analysis
 
area under the curve in matlab

Hi,
i have a question about the numerical methodes used , isnt those justan apprxiamation, and if we have the values of x,y at all points we can just add the y values,
thnx
 

area under a curve matlab

Yes, all the numerical methods are just approximations of an actual function.

Really if you just added up all the y values this would just be an approximation as well as you will not actually know all the values of the function at all times.

ie let's say you have a function f(x) and you know f(5),f(5.1),f(5.2). Since you don't actually know f(5.11), f(5.111), f(5.1111) etc if you simply add up all the y values it will still be an approximation. As your step size (step size=0.1 for using 5,5.1,5.2...) decreases the error of your approximation decreases as well. Once your step size approaches 0, you get the integral of the function.

The point of the numerical methods is to reduce the error between your approximation and the integral of the real function.
 

calculate area under curve matlab

Thanks,

I solved the problem with trapz(x,y)
 
area under graph matlab

Numerical methods are just an approximation but some of the methods provide very accurate results. Spaceflight is computed numerically and I don't think that is poor math. Also some problems are extremely hard to solve symbolically, and besides if you are going to implement the result on a MCU / PC / etc then it is pintless to have endless accuracy as it doen's exist in PCs (finite wordlength problem)

Cheers
Slayer
 

matlab area under the curve

I just wanted to know if the following gives the AUC for given values x,y

integral = ppval(fnint(csape(x,y)),max(x))
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top