MATLAB: Can i only use half of the number of the cores in parfor loops

coresparforparpoolpct

when i use parpool(coreNum) to call cores to run the program parallelly,my computer have 48cores,but i can use 28cores maximize, i don't know how the PCT(parallel computing toolbox) limit the number of the cores.
corenum=24;
matlabpool('size');
matlabpool(coreNum);
parfor i=1:150
%parfor code
.......
end

Best Answer

Edit your "local" parpool profile to increase the number of workers.
The default number of workers is the same as the number of physical cores.
When you are given half as many as you expect, then typically the number you are expecting is really the number of threads permitted with hyperthreading, rather than the number of physical cores.
Hyperthreading is often not a good idea when you are performing heavy mathematical calculations.