Matlab code samples from thesis