Update matlab code