tststr = path;

while ~isempty(tststr)

   [dirstr,tststr] = strtok (tststr,':');

   if (~isempty(findstr(dirstr,'toolbox')) & ...
        isempty(findstr(dirstr,'netcdf')) & ...
        isempty(findstr(dirstr,'mexcdf')) & ...
        isempty(findstr(dirstr,'toolbox/matlab')) );

      rmpath(dirstr);
   end;
end;

clear tststr dirstr
