File Exchange Pick of the Week

October 23rd, 2007

MATLAB can “txt msg u :)”

People have used different methods over the years to have MATLAB alert them when MATLAB is done with a long set of calculations from playing a sound file, to sending an e-mail, or now sending a text to your cell phone.

This is a nice little mash-up that uses SENDMAIL to send mail to your Google Gmail account with the right formatting that tells Google to send the text for you.

Video Content

This is a well written piece of code with nice help and good examples. How will you use this, I would love to hear the story. Click here to download it.

3 Responses to “MATLAB can “txt msg u :)””

  1. Tim Davis replied on :

    This is really cool, but entering a password in plain text into a file is a really bad security risk; particularly if that file has the word “password” on the same line. Yikes! Makes for a good target via an automatic file search.

    It would be better if the password was encrypted somehow. For example, a MATLAB GUI could prompt you for your email and password. Then that GUI could twiddle the password with some a reversible operation and then that password could be saved in a MATLAB *.mat file. At least that would make it hard for a non-MATLAB savvy hacker, or virus, to sniff out the password.

    Then, in addition, the m-file here should not use the variable name “password” or use the word “password” in any comments.

    I’m sure there are better techniques - Java, via MATLAB, can do encryption and decryption, for example.

  2. Doug replied on :

    Tim,

    An excellent thought. Anyone made a little encryption routine for MATLAB? If not, this GUI that I promoted earlier:

    http://blogs.mathworks.com/pick/2007/10/05/masking-typed-passwords-with-asterisks/

    might be helpful!

    Thanks,
    Doug

  3. Ke Feng replied on :

    If you know an SMTP server which doesn’t require login (you company may provide you one), you can use that to avoid the password line. If you don’t know any SMTP server, you can install one free on your own computer:
    http://www.softstack.com/freesmtp.html.

    To use your own (or your company’s) SMTP server, delete the following lines:
    password = ‘xxxxxxxxx’;
    setpref(’Internet’,'SMTP_Username’,mail);
    setpref(’Internet’,'SMTP_Password’,password);
    props = java.lang.System.getProperties;
    props.setProperty(’mail.smtp.auth’,'true’);
    props.setProperty(’mail.smtp.socketFactory.class’, ‘javax.net.ssl.SSLSocketFactory’);
    props.setProperty(’mail.smtp.socketFactory.port’,'465′);

    and change the following line:
    setpref(’Internet’,'SMTP_Server’,’smtp.gmail.com’);
    to your own server. If you use that program I mentioned above, use ‘127.0.0.1′ instead of ’smtp.gmail.com’. Then you won’t need any password.

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • oleg: The author has implemented skewness, kurtosis and checks answering appropriately to the critic.
  • Ashok: how to store 10 or more random number in a loop a loop for i = 1:n mean(i) = input(’enter the mean value...
  • Ben: Doug, Thanks for the very helpful videos! Uitables seem like a convenient way to make a customized property...
  • oleg: Allstats has no checks, no comments and could also be improved (talking about prctile implementatio). Not to...
  • Todd: Additional information and a link to download free MATLAB and Simulink LEGO MINDSTORMS NXT code can be found at...
  • Doug: @Leo, Here is the “English version” of that code. “vec = []” makes an empty variable...
  • leo: Dear Doug I have a question in your code ‘October 9th, 2009 at 13:53′ vec = []; vec = [vec val]; I...
  • Shanker Keshavdas: You sir, are a gentleman and a scholar… No really, helped me out a lot. As to what is...
  • Quan Zheng: how can I get a copy of stepspecs.m?
  • Doug: @Lucy I think this is what you seek to move a line with the mouse in MATLAB. http://blogs.math...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.