Matlab function for trap, very very basic