Matlab codes used during the PhD