How to modify different part of a same array on the different index of a parfor loop?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I am working on the last version of Matlab (R2015a) and deal with a lot of signals from several sensors. For example, I can have 4000 signals from 20 sensors, and each signal is an array of 512 points. In my work, I calculate the variance on a slippery window of 5 points for each signal and use the result after (the result is an array of the same size than the signal treated). My objective is to realise this calculation of the sensors 1 to 5, in the same time of the one with sensors 6 to 10, 11 to 15 and 16 to 20 using the different cores of my computer. I am discovering the toolbox which permits to deal with pools and the parfor function. There is a lot of conditions to respect, ok, but I don't find the answer at my question:
Can we modify the differents part of a same array in the different index of the loop? For example:
parpool(4)
array = ones(1,512);
limit = floor(length(array/4));
parfor i=1:1:4
array(1+(i-1)*lim:i*lim) = function();
end
I thank you in advance for your help. Best regards.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!