matlab code updated