*why* easter egg in MATLAB

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?

 Respuesta aceptada

Jonathan Epperl
Jonathan Epperl el 1 de Feb. de 2013

1 voto

S = evalc('why')

Más respuestas (2)

Daniell Algar
Daniell Algar el 1 de Feb. de 2013
Editada: Daniell Algar el 1 de Feb. de 2013

0 votos

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.

Categorías

Más información sobre Holidays / Seasons en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by