Added more pre-processing (generate the run parameters Mat file)