Quantitative finance collector
C++ Matlab VBA/Excel Java Mathematica R/Splus Net Code Site Other
Jul 6

Send SMS in Matlab

Posted by abiao at 13:17 | Code » Matlab | Comments(8) | Reads(18316)
Ros is a colleague of mine in the same office, his main research is empirical analysis of different option pricing models, and as a result, he often use several computers on different desks to run his matlab codes, which is time-consuming and not rare to last 2 or 3 days. So he has to come back office frequently to check which computer has finished the task. It sounds boring, why not write a small script to send SMS message to you automatically when your matlab stops running?

Send Text Message to Cell Phone is such a great file I found recently, bascially what it does is to send email via sendmail function of Matlab from your gmail box to your cell phone carrier, and then your cell phone carrier forwards the email to you as a text message.

Problem
However, it works for US based cell phones only, I have tried on my UK T-mobile phone and it seems UK T-mobile doesn't support such a mail to SMS service (correct me if I am wrong).

Solution
Fortunately, I came across SMS service website which allows people to send up to 3 free email to SMS per day, it should be enough for our use in Matlab. Add the following line in the switch case after line 55
case 'uk';    emailto = strcat(number,'@x-onsms.com');

that's it, the email will be delivered as an SMS to your mobile. Do let me know if you are aware of a better alternative.

So what you need to do is to put the function send_text_message at the end of your file, it will then send you a message automatically, for example
send_text_message('079-123-456','UK', 'Desk 12 Calculation Done','Now you can shut down the computer')

What else can it be used? stock price alert? profit threshold alarm? you name it.

Possible error

Depends on your Matlab version and firewall setting, you may notice the following errors:
1, ??? Error using ==> sendmail
530 5.7.0 Must issue a STARTTLS command first

This could happen for MATLAB 7.1 (R14SP3) and before, you may have to upgrade your version.

2, Could not connect to SMTP host: smtp.gmail.com, port: 25;
Connection timed out: connect

This is due to your firewall or anti-virus software setting. you are not allowed to send email from port 25. What you shall do is too add an exception and let your computer know this action is safe. For instance, I have McAfee, to add an exception, open its control console -> double click access protection -> anti-virus standard protection -> prevent mass mailing worms from sending mails -> Edit
Open in new window

add Matlab.exe as a process to be excluded, save it, done.
Open in new window

Ros, you don't have to check computers one by one. Sounds useful? download the file at http://www.mathworks.com/matlabcentral/fileexchange/16649, don't forget to change the email address and password at the beginning of the file.


Tags: ,
best essay websites Homepage
How is this even possible as I consider myself to be a MATLAB expert. I also have a lot of best essay websites which are helping so many students around the world with their essays.
movies jackets Email Homepage
Surely, we are using development wherever in the urban territories as we use mobile phones generally without fizzle. We use lift rather stairways to go up or down. It's all occasion by virtue of development. This is an amazing article since you have shared few to a great degree fundamental information about the advancement.
pay to write my essay Email Homepage
I am occupied in my working and this work is increasingly essential for me. Here is might be the absolute best things and every one of these things are beneficial for me and furthermore for my future. To its everything on us that how we can control this circumstance.
Airport Transportation Email Homepage
I loved the all the links. Can i post these on writing services? So that a larger audience could check these amazing links. Do post more of such stuff.
assignment writers Email Homepage
Interesting! This article is full of information regarding choosing your profession according to your choice. Choose that profession in which you have some interest, potential to do something, you feel happy and safe. Don’t go for the thing which kill your personality and confidence.
Skycap Loans Email Homepage
Skycap Loans provides loans up to $10,000 and the application process is quick and easy, followed by a fast loan decision. If you’re improving your spending habits, you may never have to use a service like this. But it’s good to know it’s there.
glamour jackets Email Homepage
This post is very comprehensive about Florida's wildlife. This is the greatest initiative for making the wildlife secured. I really appreciate this initiative because it will give pure pleasure to the life of so sensitive creation.
Blade Runner Trench Coat Email Homepage
Good post. Thanks for sharing with us. I just loved your way of presentation. I enjoyed reading this .Thanks for sharing and keep writing. It is good to read blogs like this. As constantly, we appreciate yourself assurance and accept as true within us.
Pages: 1/1 First page 1 Final page
Add a comment
Emots
Enable HTML
Enable UBB
Enable Emots
Hidden
Remember
Nickname   Password   Optional
Site URI   Email   [Register]