Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Ray
Posts:
11
Registered:
7/6/08
|
|
Re: using matlab in batch mode
Posted:
Jul 8, 2008 4:02 AM
|
|
"Titus" <titus.edelhofer@mathworks.de> wrote in message <g4sqds$lu8$1@fred.mathworks.com>... > > "Ray " <RayMitchell@MeanOldTeacher.com> schrieb im Newsbeitrag > news:g4sjhl$3b5$1@fred.mathworks.com... > > roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in > > message <g4she2$ec1$1@canopus.cc.umanitoba.ca>... > >> In article <d91c5c5c-8e72-4ea6-849e- > > 0eb384bf20df@z66g2000hsc.googlegroups.com>, > >> mauro <mauro.australia@gmail.com> wrote: > >> > >> >I tried this, but it opens anyway the "desktop", and > > there is this > >> >message: > >> >"??? Undefined variable "testRemote" or > > class "testRemote.m"." > >> >I called "testRemote.m" a little matlab test program, > > and I launched > >> >exactly this > >> >matlab -nosplash -r testRemote.m > >> >from the same directory where testRemote.m is!!! > >> > >> You need to leave off the '.m'. Without the .m the -r > > argument > >> becomes the command to execute (through the normal command > >> resolution procedure, which includes looking for > > functions). > >> With the .m the -r argument became a request to display > > the > >> field named 'm' of the structure named 'testRemote'. > >> > >> > >> >I also tried: > >> >matlab -nosplash -r testRemote > >> >but the same result! > >> > >> >I'm using Linux, but I don't think it is because of that > > (or at least > >> >I hope so). > >> > >> You specifically said "PC" in your original message. A > > personal computer > >> running Linux is usually referred to a "desktop", not as > > a "PC" > >> (which implies Windows.) > >> > >> The startup options for Matlab are slightly different for > > Linux; > >> the documentation I referred you to listed them. In > > particular on > >> Linux if you do not want graphics to come up, you should > > use > >> the '-nodesktop' option as well as -nosplash > >> > >> matlab -nodesktop -nosplash -r FunctionName > >> > >> -- > >> "The human mind is so strangely capricious, that, when > > freed from > >> the pressure of real misery, it becomes open and > > sensitive to the > >> ideal apprehension of ideal calamities." -- > > Sir Walter Scott > > > > > > Funny how your question is so similar to mine. I actually > > got it to work in the batch mode on a PC using the previous > > suggestions: > > > > matlab -nodesktop -nosplash -r FunctionName > > > > However, the function I am starting needs 6 arguments, with > > the first 3 being floating point numbers and the last 3 > > being strings. I've tried every weird permutation I can > > think of but the values I put in just never get through: > > > > matlab -nodesktop -nosplash -r FunctionName arg1 arg2 arg3 > > etc. > > > > What's the secret (and is it documented anywhere)? version > > R2006b. > > > > Thanks, > > Ray > > Hi Ray, > > the command after the "-r" is what you would type at the command window, > therefore: > > matlab -nodesktop -nosplash -r myFunction (1,pi,42,'hello','MATLAB', 'World') > > Titus > >
Titus,
You're absolutely correct. I could have sworn I tried that format, but obviously something was different because it works now! Thanks for your help.
Ray
|
|
|
|