matlab scripts for crem