Some matlab code.