Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Noam
Posts:
6
Registered:
6/18/07


Re: Run MATLAB from command line
Posted:
Jul 5, 2007 5:55 PM


Hi NZTideMan,
Sorry for the last post  for some reason I got it empty...
That was exactly what I did yesterday :(
I do use WinXP as you guessed. When I open the command line and type matlab h, MATLAB simply starts with the normal GUI as if I started it by doubleclicking on the matlab.exe file.
Pay attention that I didn't try to run any MATLAB script with the command you gave me. I was hoping I will get a help list from the command line that will give me instructions how to control a script from the command line.
I am intending on delivering an array to a MATLAB script, processing this array and returning some values.
I would like to do this with the help of PHP that is able to call applications via command line and for that reason I can't use any GUI functionality. Is that doable?
Anyhow  I don't manage to run MATLAB from the command line by using the command you gave me.
Any further hints you could throw at my direction? I really appreciate your efforts!
Thanks Noam
NZTideMan wrote: > > > On Jul 5, 9:58 am, Noam <behemothk...@hotmail.com> wrote: >> Hi NZTideMan, >> >> Many thanks for the tip. >> I just gave it a try but it simply opens the MATLAB GUI as usual. >> I also tried matlab nodesktop from the command line (cmd or > DOS). >> What I get is a MATLAB console without a graphical GUI but this > is >> not exactly what I am looking for. >> >> My aim is to control MATLAB with the help of the programming > language >> PHP. If I could give MATLAB commands over the DOS primpt line I > could >> do what ever I wanted with it and automate MATLAB. >> >> I have MATLAB 7.0 >> >> Thanks >> Noam >> >> >> >> >> >> NZTideMan wrote: >> >> > On Jul 5, 8:06 am, Noam <behemothk...@hotmail.com> wrote: >> >> Hi all, >> >> >> I would like to use MATLAB from the windows command line. I >> need >> > some >> >> scripts to run in the background but I couldn't really find a >> way >> > how >> >> to do this. I also look in the site for some clues on how to > do >> > it >> >> but till now I couldn't find anything about it. I am sure it > is >> > out >> >> there  some list of commands or some tips about it. >> >> >> Do you know a link or how this is being done?? >> >> >> Thank >> >> Noam >> >> > Did you try typing: >> > matlab h >> > from a DOS window? >> > In brief, you can run your .m file, say mymfile.m like this: >> > matlab r mymfile >> > providing it is in the Matlab path. Hide quoted text  >> >>  Show quoted text  > > I assume you're using Win XP??? > You need to go to Programs\Accessories\Command Prompt > A black window should open. > Type: > matlab h > > Believe me, it works. > I have 25 routines operating on an hourly schedule using the matlab > r > facility. > The only thing you need to be aware of is that you need an exit at > the > bottom of each .m file, otherwise a Matlab will open each time and > stay open. I found the Matlab r2006b did not do this properly and > one > morning I ended up with about 400 Matlabs open. I fixed this by > reverting to Version 2006a. > > >



