Solution ID: 1-8T166L answers my first question; the folders in question should not be in the path. (Tech-support helped me find that answer.) I cannot figure out how the folders were added to the search path.
I removed the folders from the search path with the function, remove_paths_Solution_ID_1_8T166L (attached below). Steps:
- copy all the warning messages to a text file, e.g. named name_conflict.txt
- run remove_paths_Solution_ID_1_8T166L(fullfile(folderspec,name_conflict.txt)). The folders are removed, but the search path is not saved.
- inspect the search path and use Matlab
- if "everything" is ok, save the search path, if not, close Matlab without saving the search path.
function folder_list = remove_paths_Solution_ID_1_8T166L( filespec )
% http://www.mathworks.se/support/solutions/en/data/1-8T166L/index.html
% Solution ID: 1-8T166L
% Subject: Why do I get "same name as a MATLAB builtin" warnings on startup?
narginchk( 0, 1 )
if nargin == 0
filespec = 'h:\m\Code2TMW\Path_potential_name_conflict.txt';
end
fid = fopen( filespec );
cac = textscan( fid, '%s', 'Delimiter', '\n' );
fclose( fid );
expr = '(?<=Warning: Function ).+?(?= has the same name as a MATLAB builtin)';
folder_list = cellfun( @(str) fileparts(char(regexp(str,expr,'match'))) ...
, cac{1}, 'uni', false );
folder_list = unique( folder_list );
cellfun( @rmpath, folder_list )
end