Skip to content

pathstr2cellarray

  PATHSTR2CELLARRAY - Convert a path string to a cell list of strings

    PATH_CELLSTR = PATHSTR2CELLARRAY

    Converts the current path string to a cell list of strings in
    PATH_CELLSTR.  

    One can also use the constructions:
        PATH_CELLSTR = PATHSTR2CELLARRAY(PATHSTR)
          to specify a path string other than the current PATH, or
        PATH_CELLSTR = PATHSTR2CELLARRAY(PATHSTR, SEPARATOR)
          to use a path separator other than the current PATHSEP.

    Example:  Remove all paths that have 'VH_matlab_code' in them
        path_cellstr = pathstr2cellarray;
        matches = strfind(path_cellstr,'VH_matlab_code');
        inds = find(1-isempty_cell(matches)); % find indexes of all matches
        rmpath(path_cellstr(inds));
        path_cellstr = pathstr2cellarray; % update the list to reflect the changes


    See also: PATH, PATHSEP, ISEMPTY_CELL