Matlab sample code.