Send a text message or email when a Matlab script is finished

It’s a drag to periodically check Matlab to see if a long-running script has finished. Why not go read some papers at the library and wait for Matlab to call you: “Yo, it’s Matlab. Your script’s done. […] Yeah I’ll pick up some milk. Love you.”. Well I haven’t figured out a way for Matlab to actually call your phone, but you can get it to send a text message or email:

Text message: here’s the script. It works as is for US cellphone providers. I’m on Virgin Mobile Canada, so I lifted the email-to-SMS gateway address from Wikipedia. You’ll get a text message that will be traced to an email address rather than a phone number:

Email: assuming you’re on Gmail.com, follow these instructions. On a smartphone, email should be just as good as text messaging, unless you turn off data services to conserve battery (which I do through JuiceDefender)

Extra tip: You can put your entire script inside of a try..catch block and have it send you a message when it fails for whatever reason as well.

One response to “Send a text message or email when a Matlab script is finished”

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s