# What matlab easter eggs do you know?

조회 수: 688(최근 30일)
Paulo Silva 2011년 2월 25일
댓글: Michele 2022년 4월 29일
Please post the easter eggs that you have found so far if they aren't already posted by someone else.
Let's try to make a good Matlab easter egg list because it seems that there isn't one.
What should be posted:
• Unexpected but intentional behaviour
• Special things that the programmers left for us to discover
• Extra code inside a function that can be used for other purposes
• Hidden pictures and audio clips
What shouldn't be posted:
• Repeated Easter Eggs, if someone already posted it please don't repeat
• Bugs in functions that cause trouble and might be fixed in later versions
• Matlab games that come with the program unless they aren't mentioned in the documentation (the games are in the other demos, try the xpbombs and fifteen, you can even see the code for both games)
##### 댓글 수: 14표시숨기기 이전 댓글 수: 13
Michele 2022년 4월 29일
@Walter Roberson thank you :D !

댓글을 달려면 로그인하십시오.

### 답변(8개)

Kenneth Eaton 2011년 2월 25일
편집: Kenneth Eaton 2017년 12월 11일
As Steve discussed in one of his blog posts, the default image in MATLAB is actually a steganographic image:
image
&nbsp
Just looks like an upside-down little boy, right? Well, if you rotate the 53-bits of the double precision fraction component so that each becomes the highest valued bit, you can easily see the hidden images:
&nbsp
&nbsp
Here's how I made the above image:
defImage = pow2(get(0,'DefaultImageCData'),47);
imgCell = repmat({zeros(size(defImage))},8,7);
for shift = 0:52
imgCell{shift+1} = bitrotate(defImage,shift);
end;
allImages = cell2mat(imgCell.');
imshow(allImages,[min(allImages(:)) max(allImages(:))]);
NOTE: bitrotate is a version of the built-in bitshift that I wrote to perform a circular shift of the bit pattern instead of discarding bits that overflow. I'll be placing bitrotate on the FEX soon, but for now you can just replace it with bitshift in the above code.
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
Andrew Newell 2011년 2월 25일
What - no image of Satan?

댓글을 달려면 로그인하십시오.

Paulo Silva 2011년 2월 25일
The spy function without arguments makes a cool figure (my current avatar).
The why function says random things.
Matlab comes with a great sound clip for those moments when you find a solution for a huge problem
sound(y,Fs)
The pie function (matlab 2008b and maybe later versions) doesn't allow to place the labels in a specific place but in the function code there's a variable that allows the text to be inside the pie and you might also set the distance from the center of the pie, here's a little hack that I did to pie
##### 댓글 수: 6표시숨기기 이전 댓글 수: 5
Image Analyst 2012년 1월 26일
Paulo, your avatar is no longer the "spy" image that pops up - it's Sean's dog (I think). Sean's lalala function is not in R2011b - maybe it will come out in R2012a.

댓글을 달려면 로그인하십시오.

Andrew Newell 2011년 2월 25일
This site and this site have several Easter eggs, but most don't work on 2010b. Just these work for me:
image
penny
shower
But are these really Easter eggs or just demos?
##### 댓글 수: 5표시숨기기 이전 댓글 수: 4
Sean de Wolski 2011년 2월 25일
Paulo, search Steve Eddin's Blog for 'image function' (or similar). There is quite a lot to learn there!

댓글을 달려면 로그인하십시오.

Paulo Silva 2011년 3월 5일
Today I found that these functions:
step
impulse
From the Control System Toolbox work without any arguments, there's a sort of demo that they make, very nice, I was using them for years without noticing, nice surprise, wonder why the tf function doesn't also have the same behaviour
##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

댓글을 달려면 로그인하십시오.

Saurav Kumar 2011년 4월 25일
surf(membrane) gives mathworks logo
imagesc(cool) gives the cool colors
imagesc(hot)
##### 댓글 수: 1표시숨기기 없음
Image Analyst 2012년 1월 26일
So does "logo"

댓글을 달려면 로그인하십시오.

Image Analyst 2012년 1월 26일
Not sure if they qualify as Easter eggs, but type these on the command line (verified on R2011b):
1. why
2. why are there too many input arguments?
3. xpbombs
4. fifteen
5. spy (new image is probably only version R2011b or later - clearly Sean has had some influence since he joined the Mathworks staff)
6. x=[-2:.001:2],y=(sqrt(cos(x)).*cos(200*x)+sqrt(abs(x))-0.7).*(4-x.*x).^0.01,plot(x,y);
On http://www.walkingrandomly.com/?p=2949, Cleve says " As our code base has increased, including such goodies in the MATLAB core has become problematic because of the strain it puts on rigorous automated testing. It is still possible to include them in a few “leaf” M functions, like “spy”, that other functions do not depend upon." so they will probably be fewer as time goes on.
##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

댓글을 달려면 로그인하십시오.

Dennis Jaheruddin 2013년 11월 27일
Not sure if it is really an easter egg, it is a bit simpler than most others.
The description of this function surprised me:
• eomfun
Note that it is only found in the help, not in the doc.
##### 댓글 수: 1표시숨기기 없음
Image Analyst 2013년 11월 27일
Easter eggs come and go. It's not in release R2013a. What version did you verify it in?

댓글을 달려면 로그인하십시오.

Leo Borcherding 2019년 8월 28일
life
##### 댓글 수: 1표시숨기기 없음
Leo Borcherding 2019년 8월 28일
This will pull up a Conways Game of Life Cellular simulation

댓글을 달려면 로그인하십시오.

### 범주

Find more on Descriptive Statistics and Visualization in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by