8

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?

J Doe
  • 93
  • 2
    isn't it just to avoid a single letter like "I" for a built-in? – postmortes Dec 06 '18 at 11:50
  • @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 – J Doe Dec 06 '18 at 11:52
  • 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 – postmortes Dec 06 '18 at 11:55
  • @postmortes, don't you want to post that as an answer please? – J Doe Dec 06 '18 at 11:58
  • @postmortes Not to mention the em rule (—) and en rule (–) in typography, which are the width of the letters M and N respectively. – timtfj Dec 06 '18 at 12:04
  • @timtfj, could you please tell me more specifically how that is connected with my question and where I can read more about that? – J Doe Dec 06 '18 at 12:08
  • i is often used to represent the imaginary unit $\mathrm i = \sqrt {-1}$. If you write a function that generates $I$, the identity matrix, then clearly you cannot use "i" again, since it is occupied. So this is a work around, to use "eye" to indicate the identity matrix by using the same pronunciation as the letter "I". – xbh Dec 06 '18 at 12:13
  • @JDoe There is an "alphabet" of spelt-out letter names, some more commonly used than others. Eye is one of them, and some like em and en have become established words for things. – timtfj Dec 06 '18 at 12:15
  • That's all is great. But could someone write that to the answer please? :) – J Doe Dec 06 '18 at 12:27
  • @JDoe Everything I've found suggests that eye is cheating a bit. eg https://grammarist.com/spelling/letter-names/ The WordReference forums would be a good place to ask. – timtfj Dec 06 '18 at 12:44
  • @timtfj, that's good but I've already asked the question here, so... :) – J Doe Dec 06 '18 at 12:50
  • @JDoe They'll know more about the language aspects, and there'll be no risk of people closing the discussion down as off-topic. Answerers will be able to go into as much language detail as they want. – timtfj Dec 06 '18 at 12:57
  • 1
    John Lawler, a fairly respectable linguist, gives the list here ( https://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
    – postmortes Dec 06 '18 at 14:40

1 Answers1

11

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.

postmortes
  • 6,338