Matlab code for FUND