*why* easter egg in MATLAB

7 次查看(过去 30 天)
Typing "why" into the command prompt yields a random answer. My question is: WHen I execute "why", how can I store the output string as a variable?

采纳的回答

Jonathan Epperl
Jonathan Epperl 2013-2-1
S = evalc('why')

更多回答(2 个)

Shashank Prasanna
or
>> edit why
change
function why(n)
to
function a = why(n)

Daniell Algar
Daniell Algar 2013-2-1
编辑:Daniell Algar 2013-2-1
This is quite the ugly solution but. Open a script, paste
diary('whyText.txt')
for i= 1: 10
why
end
diary off
and you'll store the answers in the current folder/whyText.txt.

类别

Help CenterFile Exchange 中查找有关 Holidays / Seasons 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by