matlab and cpp from Todd