필터 지우기
필터 지우기

How to convert this for loop to parfor loop?

조회 수: 1 (최근 30일)
Ahmad Gad
Ahmad Gad 2017년 11월 8일
편집: Ahmad Gad 2017년 11월 8일
Hello All, I am very new to parallel computing, and I am having hard time converting all my for loops to parfor loops. However, If I understood how to convert this part, I think I will be able to convert many parts of my code. Any help will be appreciated.
I = size(A,1);
J = size(B,2);
parfor i = 1:I
for j = 1:J
C(i,6*j - 5) = U(6*B(i,j) - 5,1);
C(i,6*j - 4) = U(6*B(i,j) - 4,1);
C(i,6*j - 3) = U(6*B(i,j) - 3,1);
C(i,6*j - 2) = U(6*B(i,j) - 2,1);
C(i,6*j - 1) = U(6*B(i,j) - 1,1);
C(i,6*j - 0) = U(6*B(i,j) - 0,1);
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by