Cake Eating Problem Matlab Code