Getting started writing an M-file can be difficult sometimes. It’s akin to writing a term paper. That first bit is always difficult to write.
Often when I am writing M code, I start in the Command Window, rather than the Editor, to help get the initial part of the code working in a more interactive fashion. In the Command Window I can play around with the code until I get it right. I then go back later and put the code into a function in the Editor. But instead of copying code from the Command Window or the Command History and pasting it in the Editor, I use the Command History context menu: “Create M-File”.
The “Create M-File” context menu item opens an Editor window and pre-populates the new file with any selected commands from the Command History.
The next time you find that you are working in this mode and you are ready to commit your code to a file, try using the “Create M-file” context menuitem from the Command History. This is easier and quicker than using copy/paste or re-typing the code.
Posted by Kristin Thomas
Kristin is a developer on the MATLAB Desktop team. She works primarily on the Command Window when she is not throwing herself down a mountain on her snowboard.
i have Question I had been using the Matlab R2006b beta for mac intel and the matlab menus used to appear in the Mac OSX menu bar but in 2007a they appear in the main windows. Is there a way to switch back to the preivous way ?
not sure if this is the right place but this is the dekstop team’s blog , i m hoping to find why the switch
nkj -
http://www.mathworks.com/support/bugreports/details.html?rp=230485
i tried this but on 2007a version does not seem to work
Contact support@mathworks.com and they will be able to assist you further with this.