Waiting for your code to execute is an inefficient use of time. Instead of patiently waiting by the computer, you may write a program that notifies you what happened. I've written two functions in MATLAB that help to do exactly that. The first function is called "sendToGmailFromGmail.m" which sends an email if the MATLAB script that you are testing has successfully completed. The second function is called "sendToGmailFromGmailError.m" which sends an email containing MATLAB error messages.
Try
A
sendToGmailFromGmail('senderEmailInQuotes@gmail.com','yourPasswordForSenderEmail','recipientEmailInQuotes@gmail.com')
Catch ME
end
Using the above code, you can receive or receive automatic notifications detailing that your code has completed successfully, or an automatic notification detailing the encountered error, so that you do not have to sit next to your computer while waiting for a simulation to finish.