MATLAB: Does the error “Attempt to execute SCRIPT settings as a function: C:\..\..\..\settings.m occur and how to fix it

Parallel Computing Toolbox

Why does MATLAB throw an error when executing one of the commands below?
>> parpool
>> parallel.Settings
Invalid default value for property 'ParalleNode' in class 'parallel.internal.settings.ParallelSettingsTree':
Attempt to execute SCRIPT settings as a function:
"C:\Users\..\..\settings.m"

Best Answer

One of the reasons for this error is the user's file named "settings.m" file in "C:\Users..\..\" directory as shown in the error message. When executing the commands like "parpool", MATLAB is trying to access its built-in script "settings.m". In this case, it is being shadowed by "settings.m" in the "C:\Users\..\.." directory and hence the error occurs.
The workaround is to rename the "settings.m" in "C:\Users\..\.." to avoid name conflict with MATLAB built-in functions.