- Undocumented Matlab - https://undocumentedmatlab.com -

Spy Easter egg take 2

Posted By Yair Altman On April 4, 2012 | 6 Comments

Three years ago, I posted a short post [1] about Matlab’s built-in Easter egg in the spy function. Apparently, when running spy with no input arguments, it uses an undocumented default built-in sparse matrix that generates the white spy in the famous Spy vs. Spy [2] comics series:

>> spy;

Matlab spy Easter egg

As was recently reported [3] by Aurélien, the default built-in sparse matrix has changed in R2011a (not R2011b as in the original report):
Matlab spy Easter egg

If you ask me, the previous (white spy) image had more relevance to the spy function… I assume the new image was not chosen arbitrarily – if anyone has some insight as to why this image was chosen and its relevance to spy, please post a comment.
Addendum: The original spy image can still be generated using the following code snippet:

c = [';@3EA4:aei7]ced.CFHE;4\T>*Y>,dL0,HOQQMJLJE9PX[[Q.ZF.\JTCA1dd'
i = double(c(:)-32);
j = cumsum(diff([0; i])<=0) + 1;
S = sparse(i,j,1)';

Happy Easter / Passover everybody!

Categories: Low risk of breaking in future versions, Stock Matlab function, Undocumented feature

6 Comments (Open | Close)

6 Comments To "Spy Easter egg take 2"

#1 Comment By Daniel Shub On April 4, 2012 @ 12:07

If you trust the comment at MATLAB answers: [12] it is Sean de Wolski’s dog. Sean is a relatively new employee at TMW and a frequent contributor to Answers. I think the dog is on his current avatar: [13]

#2 Comment By Michelle Hirsch On April 10, 2012 @ 09:00

Close, but it’s not Sean’s dog. The dog belongs to the lead developer of the sparse matrix functions in MATLAB.

#3 Comment By naor On April 4, 2012 @ 20:39

I too was disappointed last year when I realized the spy was gone. Perhaps it is still reachable in some undocumented way?

#4 Comment By Yair Altman On April 5, 2012 @ 00:39

@Naor – I’ve added an addendum showing how you can regenerate the old spy image

#5 Comment By Oleg Komarov On June 29, 2013 @ 04:18

Hi Yair,

the spy snippet has a vertcat error in c as a poster mentioned on SO. I answered with the error free snippet [14].

#6 Comment By Yair Altman On June 29, 2013 @ 11:03

@Oleg – thanks. This was due to a bug in the WordPress code that renders < characters – It's now fixed. I had to revert to a sub-optimal non-syntax-highlighted rendering of the code, but at least it's now correct.

Article printed from Undocumented Matlab: https://undocumentedmatlab.com

URL to article: https://undocumentedmatlab.com/articles/spy-easter-egg-take-2

URLs in this post:

[1] short post: http://undocumentedmatlab.com/blog/spy-easter-egg/

[2] Spy vs. Spy: http://en.wikipedia.org/wiki/Spy_vs._Spy

[3] reported: http://blog.developpez.com/matlab4geek/p10681/pensee-matlab-du-jour/notre-vieil-espion-qui-a-pris-sa-retrait/?page=2

[4] training courses: http://undocumentedmatlab.com/training/

[5] email me: mailto:%20altmany%20@gmail.com?subject=Matlab%20courses&body=Hi%20Yair,%20&cc=;&bcc=

[6] Spy Easter egg : https://undocumentedmatlab.com/articles/spy-easter-egg

[7] Image Easter egg : https://undocumentedmatlab.com/articles/image-easter-egg

[8] ishghandle's undocumented input parameter : https://undocumentedmatlab.com/articles/ishghandle-undocumented-input-parameter

[9] Plot LimInclude properties : https://undocumentedmatlab.com/articles/plot-liminclude-properties

[10] Plot legend title : https://undocumentedmatlab.com/articles/plot-legend-title

[11] Customizing axes part 5 – origin crossover and labels : https://undocumentedmatlab.com/articles/customizing-axes-part-5-origin-crossover-and-labels

[12] : http://www.mathworks.com/matlabcentral/answers/2001-what-matlab-easter-eggs-do-you-know#answer_3077

[13] : http://www.mathworks.com/matlabcentral/answers/contributors/3208495-sean-de-wolski

[14] : http://stackoverflow.com/questions/17378200/matlab-easter-egg-spy-vs-spy/17379616#17379616

Copyright © Yair Altman - Undocumented Matlab. All rights reserved.