Why isn't MATLAB using the full CPU?
34 views (last 30 days)
Show older comments
MathWorks Support Team
on 5 Apr 2017
Answered: MathWorks Support Team
on 5 Apr 2017
When I am using my software, it is very slow and it uses an average of 15% of my CPU capacity. I would like to know if there is a way to make sure that MATLAB can use the full capacity of my computer.
Accepted Answer
MathWorks Support Team
on 5 Apr 2017
In general, MATLAB is single threaded except for some lower level BLAS routines that are multithreaded. Therefore, CPU utilization may vary depending on what function you are running.
If you have a license for the Parallel Computing Toolbox, and your problem is parallelizable, you can use more of the CPU’s resources by spawning a pool of workers.
If you cannot use the Parallel Computing Toolbox, there are other ways that you can speed up your code. MATLAB has a profiler to determine where a program is spending time. For more information on using the profiler, please refer to this documentation link:
There are other ways to improve performance, such as preallocation of variables and vectorization. Additionally, if there are other CPU intensive applications running in the background, this could restrict the CPU utilization for MATLAB. Please refer to the following documentation link for more details on these suggestions, and other techniques:
0 Comments
More Answers (0)
See Also
Categories
Find more on Performance and Memory in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!