"Marcio Barbalho" <email@example.com> wrote in message <firstname.lastname@example.org>... > Hello dear friends... > > I would to know if you know any other numerical integration method besides 'trapz' given x an y vectors: > > Area = trapz(x,y) > > my data are kind of randomic and I have obtained areas that are not so precise, numbers are not matching...So I was wondering if you could give some help on increasing the performance of matlab's numerical integrators. > > Many thanks
It all depends on what you mean by "randomic". As Urs says, there is no magic wand to make good data out of bad. If your data is bad because it is noisy, then trapz results are about as good as you are going to get.
On the other hand if your data is comparatively free of noise and is accurately obtained from a function which is smoothly varying, meaning that it's higher derivatives are not excessively large, then there is hope for better accuracy from higher order integration methods.
There are a number of these in the file exchange, including one I wrote which does cubic type approximation, but they all require that the discrete data be derived from smooth functions. Mine approximates the integral over each interval using the two endpoints of the interval and two other points at the ends of the two adjacent intervals. It computes the integral a cubic polynomial would have over the central interval if it runs through all four points. However the size of the inevitable error it makes depends on how large the underlying function's fourth derivative is, based on the mean value theorem of calculus. For trapz the mean value theorem expresses the error in terms of its second derivative.