Loren on the Art of MATLAB

Turn ideas into MATLAB

Note

Loren on the Art of MATLAB has been archived and will not be updated.

MATLAB Language Translator

Google recently made a splash about its e-api-tools-for.html latest language tools. Translating one computer language to another is useful but passé. But suppose you could translate a computer language to
a human language: MATLAB -> English and English -> MATLAB. Type in your word problem and get the code instantly. It could
help you with your MATLAB accent, or, if English is not your first natural language, you might learn some vernacular from
MATLAB's interpretation.

 

Contents

Some Translations

In particular, such a translator might be good at recognizing and translating common phrases. Here are but a few of the phrases
the translator (under development) gets right.

  • eye(newt), from Shakespeare's hags
  • ceil(approval), from Good Housekeeping
  • wait(theWorld)
  • angle(repose), an excellent book by Wallace Stegner
  • balance(power), axis(power), etc., assuming you've pre-empted the function with your own variable or function, of course
  • gallery(art)
  • length(day) (day has the same caveat as power above)
  • residue(ashes)
  • sign(theTimes)
  • sound(music), thanks to Julie Andrews, among others
  • theTotal = sum(theParts)

Notice how the parentheses are pronounced in English : "of".

Command Duality

The MATLAB translator understands command-function duality and the nuances of English. It would not do to write the last example as

  • wait theWorld

Nor would

  • polar bear

be okay because polar doesn't take a character array for its first argument.

However, it would be okay to say

  • global warming
  • median strip

What Are Your Translation Needs?

Sure, we will translate between MATLAB and other languages once we have the English version ready to go. And, I should warn
you that Steve Eddins from the Steve on Image Processing blog has been working for years on mindread.m as well. Beyond these two obvious needs, what other translation needs do you have? Or other thoughts on this post? What
about MATLAB poetry (Tim?)? Let me know here.

Published with MATLAB® 7.6


  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.