MATLAB: How to speed up calculations

code optimizationcomputation time

Hello, I am running a code creating and then analyzing large arrays (let's say consisting 15M data). My problem is that, when the code is running, I observe that the cpu usage is at 25% and RAM usge is about 410 Mb. My computer has 4 gb ram and is 2.9 Ghz. How can I make matlab to use more cpu and ram in order to speed up the calculations. (now the calculation time is about 2 hours). ps: I pre allocated every array, also changed the virtual memory size and swap size and tried to switch 3gb from command prompt with BCDEdit /set increaseuserva 3072 command. Any help would be appreciated.

Best Answer

You have made a lot of things already about hardware enhancement like setting the 3GB Switch. You should use the profiler of MATLAB to find bottlenecks if any.