You can redirect the command window to a text file using the diary command.
Here's an example:
main.m141 chars9 lines
After running this code, the file mylog.txt will be created in the current directory, and it will contain the text "Hello world".
Note that all output to the command window will be logged to the file until diary off is called, so make sure to turn off logging when you're done.
gistlibby LogSnag