Matlab code for 3 distributions