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

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

|
  • print

댓글

댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.