From: Matt on
Your regexp command didn't work for me. I don't know much about regexps, but replacing your line with the following command got your function to work:

entries = regexp(path, ['[^',pathsep,']*',pathsep],'match');

Thomas <thomas(a)dohmke.de> wrote in message <enj5dc$qev$03$1(a)news.t-online.com>...
> David the Dude schrieb:
> > I have a ton of .svn directories that I want to exclude from the
> > matlab path. How can I do it?
>
> How about this little method:
>
> *****
> function filter_path(pattern)
>
> all = path;
> [entries] = regexp(all, '([^;]+);', 'tokens');
> for i = 1:length(entries)
> entry = char(entries{i});
> if (~isempty(strfind(entry, pattern)))
> rmpath(entry);
> end;
> end;
> *****
>
> Tested with:
> >> addpath('s:\temp\.svn\');
> >> filter_path('.svn');
>
> Hope that helps,
>
> Thomas