indexing problem in parfor
1 回表示 (過去 30 日間)
古いコメントを表示
Even having code, which should run in parralel, Matlab writes: valid indeces for 'ndLog' are restricted in PARFOR loops.
Would anybody please know, what is the issue?
Thank you very much,
Rafael
al = [30 40 50]; m = [40 50 60];
tn=10; cm=cumsum(m); S=sum(m); r=[0 1];
ndLog=zeros(sum(m)*numel(r)*numel(al)*tn,5);
parfor a = 1:tn
for aa = 1:numel(al)
for k=1:numel(r)
for mm = 1:numel(m)
ind = -m(mm)+1+cm(mm) + (k-1)*S + (aa-1)*numel(r)*S +...
(a-1)*numel(al)*numel(r)*S;
ndLog(ind,:) = [a mm aa k 1];
end
end
end
end
8 件のコメント
Shivam Prasad
2019 年 10 月 17 日
編集済み: Shivam Prasad
2019 年 10 月 17 日
Hi Rafael,
Please refer to this link regarding variables in parfor loops:- https://www.mathworks.com/help/parallel-computing/troubleshoot-variables-in-parfor-loops.html
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!