Prev: Subscript formatting with "_"
Next: matlab R2008b on ubuntu: compiler and mex-files PLEASE HELP
From: John on 22 Feb 2010 11:05 Hi all, I want to execute a simple M script from the command line in a .BAT file. Right now I can open the .m file but then I have to hit "F5" to run and then close the editor. It's fine if Matlab is already up and running in a window. Any ideas? Thank you! - John
From: Walter Roberson on 22 Feb 2010 13:08 John wrote: > I want to execute a simple M script from the command line in a .BAT > file. Right now I can open the .m file but then I have to hit "F5" to > run and then close the editor. It's fine if Matlab is already up and > running in a window. Under Unix type systems, you would use the '-r' flag followed by the quoted text of the command to execute, such as matlab -r 'doanalysis(5);quit' I do not run the Windows version so I do not recall whether under Windows the flag is still -r or if it changes to /R ... I think it remains -r .
From: John on 23 Feb 2010 08:24 Walter Roberson <roberson(a)hushmail.com> wrote in message <hluhoq$bqf$2(a)canopus.cc.umanitoba.ca>... > John wrote: > > > I want to execute a simple M script from the command line in a .BAT > > file. Right now I can open the .m file but then I have to hit "F5" to > > run and then close the editor. It's fine if Matlab is already up and > > running in a window. > > Under Unix type systems, you would use the '-r' flag followed by the quoted > text of the command to execute, such as > > matlab -r 'doanalysis(5);quit' > > I do not run the Windows version so I do not recall whether under Windows the > flag is still -r or if it changes to /R ... I think it remains -r . Thank you Walter, This does work (without the single quotes in dos). However it opens a new copy of Matlab each time I run it which is slow. I'd really like to run in my already-open Matlab session. Any ideas there?
From: Jos (10584) on 23 Feb 2010 08:37 "John " <John(a)Twisthink.com> wrote in message <hlu9vn$o9j$1(a)fred.mathworks.com>... > Hi all, > > I want to execute a simple M script from the command line in a .BAT file. Right now I can open the .m file but then I have to hit "F5" to run and then close the editor. It's fine if Matlab is already up and running in a window. > > Any ideas? > > Thank you! > > - John Instead of a bat-file calling matlab why not let matlab call the batch commands, using SYSTEM or DOS, and its own m-files? hth Jos
From: John on 23 Feb 2010 08:47 > Instead of a bat-file calling matlab why not let matlab call the batch commands, using SYSTEM or DOS, and its own m-files? > > hth > Jos I'm trying to run a series of Matlab demonstration files from a presentation. Currently my best solution is to simply run the .m file directly, which opens the editor and I can just hit F5 to run and close the editor when it's finished. matlab -r fileName();exit Is good too, but slower since Matlab has to open and close each time it's called. So, I'm looking for the Holy Grail here.
|
Pages: 1 Prev: Subscript formatting with "_" Next: matlab R2008b on ubuntu: compiler and mex-files PLEASE HELP |