MATLAB: Is there a way (command line switch) to prevent execution of startup.m when starting a new Matlab instance

Is there a way (command line switch) to prevent execution of startup.m when starting a new Matlab instance? How about the same for finish.m?

Best Answer

You can write a small batch job, which creates an envorinment variable before calling Matlab:
@echo off
set NoMatlabStartupM=1
matlab
Now insert this on top of the startup.m function:
NoMatlabStartupM = getenv('NoMatlabStartupM');
if ~isempty(NoMatlabStartupM)
return;
end
No startup.m is still called, but not executed, when you start Matlab through this batch file.