maxNumCompThreads
is deprecated, but is it still working with R2014a?
I tried to force a script to use a single computational thread, but it uses 2 logical cores:
maxNumCompThreads(1); % limit MATLAB to a single computational thread.
signal = rand(1, 1000000);
for i=1:100
cwt(signal,1:10,'sym2');
i
end
Any idea why?
Setting the -singleCompThread
option when starting MATLAB does work fine (the script then uses one core only).
Note that my computer has hyperthreading, so 2 logical cores is actually only 1 physical core but usually Matlab count with logical cores, not physical ones (e.g. when setting the number of cores in a parallel pool).