I have written some new functions (trapz.m, cumtrapz.m, legendre.m). They should work like their matlab counterparts. The legendre script needs a bit of improvement, it works up to degree 40, then the result become unstable. I will try to improve the algorithm, to avoid the calculation of large factorials. You can find the new functions at my homepage in the others section.