The following line will run the function and then drop into the interactive matlab shell when finished.
matlab -nodisplay -nojvm -nosplash -nodesktop -r "MyFunc('param1')"
However if you don't want to drop into the matlab shell, then you need to add an exit
statement to the end of the command.
matlab -nodisplay -nojvm -nosplash -nodesktop -r "MyFunc('param1');exit;"