use diff approach to Matlab execution