6
$\begingroup$

Matlab, as well as some other PLs (e.g. Python's numpy package) use "eye" as a function name for creation of the identity matrix. Why is that so?

$\endgroup$
13
  • 1
    $\begingroup$ isn't it just to avoid a single letter like "I" for a built-in? $\endgroup$
    – postmortes
    Dec 6, 2018 at 11:50
  • $\begingroup$ @postmortes, maybe. But I'm personally seeing this "eye" as a biological organ. Perhaps that is because I'm not a native English speaker. I just wonder $\endgroup$
    – J Doe
    Dec 6, 2018 at 11:52
  • $\begingroup$ ah, "eye" is sometimes used to 'spell' I in English; Similarly h is 'spelled' aitch, and f is spelled eff. Probably not something you'd know if you weren't a native speaker though $\endgroup$
    – postmortes
    Dec 6, 2018 at 11:55
  • $\begingroup$ @postmortes, don't you want to post that as an answer please? $\endgroup$
    – J Doe
    Dec 6, 2018 at 11:58
  • 1
    $\begingroup$ John Lawler, a fairly respectable linguist, gives the list here ( groups.google.com/forum/#!topic/alt.usage.english/LZRjRbMHPe8 ) in a 1996 usenet post. @JDoe if I get any time at all this afternoon I'll pull this all together into an answer, but I expect someone will beat me to it $\endgroup$
    – postmortes
    Dec 6, 2018 at 14:40

1 Answer 1

7
$\begingroup$

In Matlab, i is treated as a function (see https://www.mathworks.com/help/matlab/ref/i.html ) returning the imaginary unit $\sqrt{-1}$. To avoid confusion with that, eye is used to represent the unit matrix. I couldn't find any documentation on the mathworks site explaining the choice, but the likely answer is that it's because eye is used in English as a way to spell the name of the letter 'I'.

The 'spelling-names' for English letters are given by John Lawler in this post (https://groups.google.com/forum/#!topic/alt.usage.english/LZRjRbMHPe8 ), and listed below for convenient reference.

 a  /e/       A [cap preferred]
 b  /bi/      B [ditto; 'bee' more common than 'be']
 c  /si/      C [  ", 'see'; but 'C-note' and 'cee-note' both occur]
 d  /di/      dee
 e  /i/       ee or E
 f  /ef/      ef, or eff ['you effing idiot!']
 g  /ji/      gee ['jee' is possible but not recommended]
 h  /ec^/     aitch [the 't' seems to be required]
 i  /ay/      I or aye, occasionally 'eye'; cf 'eye-dialect'
 j  /je/      jay
 k  /ke/      kay
 l  /El/      el, or ell
 m  /Em/      em [cf em-dash]
 n  /En/      en [cf en-dash]
 o  /o/       oh or owe ['ow' makes more sense but is already /aw/]
 p  /pi/      P ['pee' is less common, because of its vulgar homophone]
 q  /kyu/     queue, or cue [not recommended]`
 r  /ar/      are? ar? ahr? arr?  nothing looks good; use R
 s  /es/      es or ess
 t  /ti/      tee
 u  /yu/      you, or yoo
 v  /vi/      vee [delta-vee, or dee-vee]
 w  /d@b@lyu/ double-u or doubleyou
 x  /Eks/     ex  [shorter to spell than to pronounce!]
 y  /way/     why, or wye
 z  /zi/      zee [US usage; elsewhere zed]
Spelling the letter names is not frequent enough in written English to be standard.  There's 
lots of variation.

As noted in both John Lawler's list and timtfj's comment, some of the letter names have taken on lives of their own, with em- and en-dash occuring in printing and denoting the width of a capital M or capital N in the chosen font.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.