Three years ago, I posted a short post 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 comics series:
>> spy; |
As was recently reported by Aurélien, the default built-in sparse matrix has changed in R2011a (not R2011b as in the original report):
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'
'<A;FB:;bfj8^df//DGIF<5]UF+ZH-eM>-IorRPNMPIE-Y\\R8[I8]SUDW2e+'
'=4BGC;<cgk9_e00DEOJG=6^VG,[I.fN?5jpsSQPNQPF.Z,]S9`S9cTWVX:+,'
':5CHD<=4hlh`f11EFPKHA7&WH-\J/gOC?kqtTRRORQJ8--^TB+T=dWYWY;,_'
';6D3E=>7imiag2IFOQLID8''XI.]K0"PD@l32UZhP//P988_WC,U>+Z^Y\<2`'
'<82BF>?8jnjbhLJGPRMJE9/YJ/`L1#QMC$;;V[iv09QE99,XD.YB,[_\]=3a'
'>9;CG?@9kokc2MKHQSOKF:0ZL0aM2$RNG%AAW\jw9E.FEE-_G8aG.d`]_W5+'
'?:CDH@A:lpld3NLIRTPLG=1[M1bN3%SOH4BBX]kx:J9LLL8`H9bJ/+d_dX6,'
'@;DEIAB;mqmePOMJSUQMJ>2\N2cO4&TPP@HCY^lyDKEMMN9+I@+S8,+deY7^'
'8@EFJBC<4rnfQPNPTVRNKB3]O3dP5''UQQCIDZ_mzEPFNNOE,RA,T9/,++\8_'
'9A2G3CD=544gRQPQUWUOLE4^P4"Q6(VRRIJE[`n{KQKOOPK-SE.W:F/,,]Z+'
':BDH4DE>655hSRQRVXVPMF5_Q5#R>)eSSJKF\ao0L.L-WUL.VF8XCH001_[,'
';3EI<EO?766iTSRSWYWQNG6$R6''S?*fTTlLQ]b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'];
i = double(c(:)-32);
j = cumsum(diff([0; i])<=0) + 1;
S = sparse(i,j,1)';
spy(S)
Happy Easter / Passover everybody!
If you trust the comment at MATLAB answers: http://www.mathworks.com/matlabcentral/answers/2001-what-matlab-easter-eggs-do-you-know#answer_3077 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: http://www.mathworks.com/matlabcentral/answers/contributors/3208495-sean-de-wolski
Close, but it’s not Sean’s dog. The dog belongs to the lead developer of the sparse matrix functions in MATLAB.
I too was disappointed last year when I realized the spy was gone. Perhaps it is still reachable in some undocumented way?
@Naor – I’ve added an addendum showing how you can regenerate the old spy image
Hi Yair,
the spy snippet has a vertcat error in c as a poster mentioned on SO. I answered with the error free snippet here.
@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.