Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to run matlab in a cluster from various folders
Replies: 3   Last Post: Jan 2, 2013 6:27 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: How to run matlab in a cluster from various folders
Posted: Dec 31, 2012 12:22 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Joan " <jm3364@columbia.edu> wrote in message
news:kb991b$cje$1@newscl01ah.mathworks.com...
> Hi, I am trying to run a matlab file "main.m" that is located in folder
> ~/home/matlab. Ideally I want to locate an .sh file in ~/home that runs
> the matlab file main.m located in ~/home/matlab. How can I do it?
>
> It is easy to do it when both my .sh file and matlab file are in the same
> folder. I then need to write
> matlab -nodesktop -nosplash -r main
>
> and it works fine. However I cannot find how to run something like
>
> matlab -nodesktop -nosplash -r matlab/main


http://www.mathworks.com/help/matlab/matlab_env/startup-options.html

"Enclose the statement in double quotation marks ("statement"). Use
semicolons or commas to separate multiple statements"

So "cd('/home/jm3364/matlab'); main" would work as the value for the -r
startup option.

Or create a startup.m file in the directory in which you start MATLAB and
have that script CD to the appropriate directory and call main.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.