Matlab scripts for journal article