I am very thankful! It works wonderfully. Just what I have been looking
Ken Davis wrote:
> "Roy S Schestowitz"
>> wrote in message email@example.com">news:firstname.lastname@example.org...
>> Hi all,
>> When I use genpath() I get a string output which is the sub-directories
>> a ':' delimiter. For example,
>> Is there an easy way to convert this string into an array of directories?
>> need to feed it to another function in an array form.
>> Thanks very much,
>> PS - A note to the MATLAB developers - is it really good practice for
>> addpath() to take a string of this form?
> function p = pathlist(R)
> % PATHLIST(R) Returns path R or current path as a cell array. The
> delimiter is the value
> % returned by the pathsep function.
> % USAGE: p = pathlist(genpath);
> % Initialize to the current path.
> if nargin < 1
> R = path;
> % Remove trailing path separator, if any.
> if ~isempty(R)
> if isequal(R(end), pathsep)
> R = R(1:end-1);
> p = strread(R, '%s', 'delimiter', pathsep); % Use generic parse function.
- From: Roy S Schestowitz <email@example.com>