added sqr matlab code