Finish off the script for the matlab session.