How can I start MATLAB with a different priority on Windows?

26 views (last 30 days)
I want to start MATLAB with a lower priority. I know that I can go into the Windows Task Manager and change the priority of MATLAB once it has started, however I would like to assign a lower priority to MATLAB at startup.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 Jul 2021
Edited: MathWorks Support Team on 13 Jul 2021
MATLAB does not have a built-in way to control its own default priority. However there are utilities of the Windows operating system which you can use to do this.
The "start" command in Windows is used to launch applications. This command has the option to set the priority of the application which is started. For example, the command:
start /BELOWNORMAL matlab
launches MATLAB with the priority "BelowNormal". If you have multiple copies of MATLAB installed on your system or if matlab.exe is not on the system path, you will need to specify the full path to the MATLAB exe file. For more information on the "start" command see:
If you are using MATLAB 7.2 (R2006a) or earlier, you could insert this command into a batch file (BAT-file) which could then be double-clicked to start MATLAB.
If you are using MATLAB 7.3 (R2006b) or later, you may notice a DOS command window that opens and does not close when you execute the start command. This is because starting in MATLAB 7.3 (R2006b), MATLAB is launched using a batch file on Windows (matlab.bat). This file also makes use of the "start" command that causes a DOS command window to open. To start MATLAB with a different priority and not have the DOS command window remain open, you can either specify the full path of the matlab.exe file or modify matlab.bat.
The matlab.exe file is located in $MATLABROOT\bin\win32 on 32-bit Windows platforms and $MATLABROOT\bin\win64 on 64-bit Windows platforms. $MATLABROOT is the MATLAB root directory on your machine that is returned by executing the following at the MATLAB Prompt:
matlabroot
The matlab.bat file is located in $MATLABROOT\bin\. You should make a copy of this file and use the modified copy of the BAT-file when launching MATLAB with a different priority. In this file you will need to modify the following line:
set START_OPTIONS=start "MATLAB" %START_WAIT%
to:
set START_OPTIONS=start "MATLAB" /BELOWNORMAL %START_WAIT%
To start MATLAB with a priority other than "BelowNormal", specify the priority flag from the "start" documentation listed above.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!