Jonathan's matlab experiments