Stuart’s MATLAB Videos

Watch and Learn

Adding a try/catch With Email Notification

One module of a large MATLAB project I maintain failed last night and caused the whole application to error-out. This is disappointing because it takes several hours to run. It was because of a typo I had entered into a string in a spreadsheet; something I might do again.

So I want add a try/catch statement around this piece of code to ensure the system is robust to the issue in the future. Also, because I want to address the root cause of the error (string typos) and the fact that the code runs during the night, I want to send myself an email notification when it fails.

Features covered in this code-along style video include:

  • try/catch, str2func
  • sendmail

Video Player is loading.
Current Time 0:00
Duration 0:00
Loaded: 0%
Stream Type LIVE
Remaining Time 0:00
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected

      Play the video in full screen mode for a better viewing experience. 

      |
      • print

      Comments

      To leave a comment, please click here to sign in to your MathWorks Account or create a new one.

      Loading...
      Go to top of page