MATLAB: How to save everything that I have worked on, then open it later and continue from where I left off

continuing work

Seriously! I have never worked in a such an unusual program! I'm used to double clicking on my desktop icon, working on whatever pops up next, clicking the save button in the left corner, then closing the file…. then at some later time I open the program and click open, find the file i made and be able to pick up where i left off! Could I get some help please – Total (Old guy) Newbie.

Best Answer

  • Warning - This may only work for me and my situation and version (which may or may not be why help material is so nebulous to a total newbie)...
    1. Upon opening, Set up a new directory/folder on your drive by clicking the \Browse for Folder" button next to the Current Directory combo box, and then use the resulting dialog box to navigate to your location of choice (it's best to stay away from MATLAB's own directories).
    2. Click the \New Folder" button, enter an appropriate name, get inside of it and press "select a folder"
    3. Now type "edit" in the command window. This brings up the editor window which is pretty awesome once you learn a few ropes. In fact, this is where you should place all your commands. Basically use it as the command window. It will give you hints and tips as well. When you want to execute your commands, click on the run button. You should see a save button now btw.
    3. Saving - After working along, maybe following a tutorial, type: save('file name') in the command window, then hit enter. the apostrophes are critical, color should be purple if Matlab is happy. If you just type save, it will call the file matlab... no prompts, just rolls you... You have just created a .mat file
    4. Saving... again... Go to the down arrow, under the save button, and select save as
    5. Give it a name and it should already be in the folder you want this particular "file" to be in, and click save. Now you have a .m file and a .mat file
    6. In the future, if you open Matlab and navigate to your folder, the .mat file will bring up the workspace (ie all your variables) The .m file will bring up the editor window with all the commands (in the editor window). Now you can continue where you left off!