automation to prepare input files

Running matlab part can be changed and after all of the entering matlab it is necessary to quit.