From: Rajeev Narayanan on
Hi,

I have many function which has to be called from different directory. However, things get really complicated with "cd" to the directory when I need to call the function. Is there any way to set a global path. Is there any example?

Thanks,
Rajeev
From: Oleg Komarov on
"Rajeev Narayanan" <rite2rajeev(a)gmail.com> wrote in message <hmet86$qcp$1(a)fred.mathworks.com>...
> Hi,
>
> I have many function which has to be called from different directory. However, things get really complicated with "cd" to the directory when I need to call the function. Is there any way to set a global path. Is there any example?
>
> Thanks,
> Rajeev
Yes,
help path, addpath

Oleg
From: ImageAnalyst on
Rajeev Narayanan:
Put something like this in your startup.m file:

% Add the Work folder and all its subfolders to the search path.
addpath(genpath('C:\Program Files\MATLAB\Work'));
cd 'C:\Program Files\MATLAB\work'

Yeah it adds a bunch of folders that you may never need to your path,
but so what, who cares? Basically it works. If you want, you can
narrow down the path to a more specific folder but you'll probably
never notice any difference.
 | 
Pages: 1
Prev: GUI Neural Networks
Next: fmincon hessian problem