Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Create setup m-file
Date: Sat, 1 Aug 2009 02:32:43 +0000 (UTC)
Organization: University of Montreal
Lines: 11
Message-ID: <h509gb$99j$1@fred.mathworks.com>
References: <h4s91j$p6e$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1249093963 9523 172.30.248.37 (1 Aug 2009 02:32:43 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 1 Aug 2009 02:32:43 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1336070
Xref: news.mathworks.com comp.soft-sys.matlab:560091


"Samb1985 " <porro99@virgilio.it> wrote in message <h4s91j$p6e$1@fred.mathworks.com>...
> I would like to create a m-file (setup.m), that will be located in the default matlab directory.
> When I execute "setup" it must find on the pc a folder "MyApp" and add its path with all its subfolders to matlab search path, so I can run my matlab application without going on File - Set Path men?.
> 
> It is possible ? how ?
> 
> Thanks in advance. 

You can define an environment variable on your system that contains the path to MyApp. Then, you edit startup.m such that it recursively runs addpath.m on that directory.

Alternatively, you can use userpath.m to change the startup directory.