View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.4 | 8 ratings Rate this file 2 Downloads (last 30 days) File Size: 1.98 KB File ID: #7499 Version: 1.0



Loginatorist (view profile)


20 Apr 2005 (Updated )

Calculates the integral of function f from a to b using ngp Gauss points.

| Watch this File

File Information


I have found that this is on average +20 times faster than 'Gauss-Legendre' file(4560), and easier to read because it is shorter.


Gauss Legendre inspired this file.

MATLAB release MATLAB 6.5.1 (R13SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
05 Feb 2013 Giuseppe Cascarino

Sorry, my fault. I did a beginner's error, it works. My apologies.

05 Feb 2013 Loginatorist

Loginatorist (view profile)

Giuseppe, what are you talking about??

>> f=inline('sin(x)/x');
>> gaussleg(f,-1,1,8)

ans =


>> f=@(x) sin(x)./x;
>> gaussleg(f,-1,1,8)

ans =


>> version

ans = (R2012a)

Comment only
29 Jan 2013 Giuseppe Cascarino

doesn't work , at least on matlab 2012

05 Oct 2006 sotos ...

28 Jan 2006 Rami Boul

27 Jan 2006 Eric Alvarez

It's slow. The culprit is the use of EIG in the subfunction GAUSS. Moreover, it eats a lot of precious memory.

05 Nov 2005 Sreekanth M.S

This program ROCKS!!
I owe the grade of my project to you! :)
Was getting pissed of by 'quad' function which cannot deal with matrices

01 Sep 2005 Ashesh CB

Definelty a simple and excellent program...

10 Aug 2005 tim cowdry

fast and easy.

25 Apr 2005

Updated to be 4% faster.

24 Oct 2005

Now checks for NaNs.

19 Dec 2005

fixed a typo.

30 Jan 2006

Increased the speed as per a suggestion.

02 Feb 2006

Higher tolerance for finding Gauss points.

Contact us