Some matlab code