On Jul 7, 4:35 pm, mauro <mauro.austra...@gmail.com> wrote: > Hi, > I want to use matlab in batch mode, but I don't know how to proceed! > I explain the problem: I will have access to my machine (when I used > to play with matlab, and where I have all the settings/datasets/etc) > but I will have only an "ssh" connection to that PC, so I will have > only a command line! No chances to work graphically! The idea is to > just run the .m without using any graphics, and without changing the > settings (changing the settings of Matlab in such machine is a > trouble). What I want is "just" run a .m file, as I do in the > graphical environment (click on the "run" button) but without opening > matlab (I have no support for graphics with my ssh). Is it possible? > > cheers, > Mauro
You can run Matlab from a command line (in Windows or Unix) using: matlab -r mfile You need to put an exit as the last line of mfile.m so that the session gets terminated. Otherwise the Matlab window will remain open and everytime you execute the command you will open a new window. I once ended up with 40 Matlabs open when I forgot to insert an exit. One nice feature about this process is that it uses the path that you have already set up.