Changed parameter passing to matlab script. various parameters are now combined into an array and then parsed once inside the matlab script. For some odd reason, the original way of passing parameters stopped working, started giving 1047 error.