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.
Get
the MATLAB code
Published with MATLAB® 7.6

My favorite feature of this code translation is the
analyze(data);
groundBreakingMonograph.tex = write(paper);
submit;
Of course, after today passes, there is always http://pdos.csail.mit.edu/scigen/
Very nice… But I keep waiting for matlab to do away with the pesky need to know the question. We need a lower level of effort. We need a function which can take the random fluctuations of the universe and give us the answer we want (kind of like a neural net… and possibly with equal accuracy! Sorry to any NN enthusiasts out there). Some might question the need for such a function, but I would say “why” not?
Dan
april 1, 2008
How about Matlab to Fortran IV? For all your retrocomputing needs…
I, for my part, eagerly await the plugins for mindread.m that generate the graphs I want: automunge.m and psychicplot.m. That and 4-D bar plots. (”I just visualize it in n dimensions and generalize to n=4.”)
;-P
That’s great! MATLAB could be the intermediate language for translation tools. You would translate your typical political speech in Russian to MATLAB code, then translate it to English.
Now the really important question is whether this functionality will be vectorized. If so maybe sign(theTimes) could be the new Nostradamus! It is also clear to me that in this day and age, weight(theWorld) had better be able to handle complex inputs!
Dan
Dan-
Looks like your into
theSwing(things)
Of course being vectorized and handling complex inputs are part of the requirements.
–Loren
Maybe you can use my recent Mie scattering routine. It’s vectorized, so the option for one wavelength is:
fullMie(’once’)
Thanks, schur(L|n), along with your fellow MathWorkers, listed below:
for adding such great tools to MATLAB. These tools are particularly effective when terminated with the semironical statement terminator, namely,
Thanks,
MATLAB is far better than those silly ads you see on web pages. It can do the following, all by itself:
MATLAB poetry? You realize it’s very dangerous thing to ask me for poetry …. :-) Here’s a recent MATLAB Haiku, although it says more about C than MATLAB:
Land-lubbers set sail,
C coding in mexFunction :
MATLUBbers at C.
You can find more of the same at
http://www.cise.ufl.edu/~davis/Horror_matrices.html
In one recent one, for Gene Golub, I “translated” Kubla Khan into “Golub,Gene” in which
A damsel with a dulcimer
In a vision once I saw:
It was an Abyssinian maid,
And on her dulcimer she played,
Singing of Mount Abora.
becomes
A damsel with a dual chip core
In a vision once I saw:
It was by math’matician made,
And on her dual chip core she played,
Singing of MATLAB aura.
Related to the reference to mindread.m: Interlisp had the DWIM function which could be applied when the debugger identified a problem. The function name was an acronym for “Do What I Mean.” It would make repairs based on a database of common errors in Lisp. The interrupted computation would then proceed.
The URL name, above, comes from UK postal regulations. I’m not making this up: it is illegal to mail “horror comics and matrices” to the UK. So what is a “horror matrix”? A very ill-conditioned one, perhaps? Here’s my definition, aka the Jabberwok, with lots of MATLAB puns:
I’m not making this up:
Matlab is a word in Urdu that means “Aim, Desire, Meaning, Motive, Object, Wish”. A similar word “matloobah,” means “requisite”. When you lack MATLAB, you have Matli, or “Malaise, Queasiness, Qualm”, and your efforts and skills are Matrookah (that is, “obsolete”).
http://www.geocities.com/urdudict/m/mat.htm
… but I *am* making this up, just this morning:
How’s that for a quadlingual poem (MATLAB, English, Urdu, and C)? ;-)
Tim-
You have outdone yourself! These are some real gems (and maybe complex too?).
–Loren