How can i run a script in the background? How can i use more computer resources?

3 次查看(过去 30 天)
Hi, i am running a script with 2 outputs:
[X, B] = function(inputs);
which iterates up to about 10^7 times (trying to reach a jamming limit of fitting objects into a bounding volume)
This iteration takes some time, and often when my computer sleeps, the matlab code freezes (i know this because i print the iterations on the screen so i can see it iterating).
Is there any way to submit something like this to run in the background so that it will run overnight? Further, is there any way to use more of my CPUs capacity to speed up the iterations?
Any help would be greatly appreciated.

回答(2 个)

Image Analyst
Image Analyst 2014-5-11
Go to Control Panel-> power options and tell your computer not to sleep.
Go to task manager (Ctrl-Shift-Esc) and right click on the process and set the priority to "High" (but never set it to real time or it won't pay attention to other processes like moving the mouse!).

Jan
Jan 2014-5-11
Under Windows you can use FEX: WinPower to disable the sleep mode during computations and enable it afterwards or shut down the machine.
To use more "CPU capacity" try to parallelize the code by a parfor loop. Or start multiple instances of Matlab, which process a part of the solution.

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by