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.

  • Beats: Not useful for everyday but very interesting. Thanks.
  • nickey: Hi Brett, I’ve tested Tao’s program and yours too. They ran successfully. I’ve tried to...
  • Kika: THANK YOU!! I’ve been trying to change the colormap but I didn’t know what to do. It was driving me crazy!...
  • Richard: Hello Doug, yet another question. I followed this tutorial: http://blinkdagger.c om/matlab/matlab-...
  • Doug: Richard, Use the compiler options file, it is found at the bottom of the dialog that you get when clicking on...
  • Richard: To whom it may concern, a solution to the dos screen annoyance is found by user ‘vihang’ in this...
  • Richard: Thank you for your reply. I understand that I can specify flags using the mcc command, but is this also...
  • Doug: Richard: Find it here: http://www.mathworks .com/access/helpdesk /help/toolbox/compil er/mcc.html Doug
  • Richard: Hello Doug, Can you explain point 56. (about the -e flag) because I can’t seem to find it. Regards,...
  • Doug: Tony, When you say the .MAT file has 984 files, you mean it has the *names* of the files. So the real problem...

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