Nested parfor loops ( a statement within a parfor loop calls a function which also contains a parfor loop)

조회 수: 1 (최근 30일)
Hi all
I need to use a parfor loop to speed up the code running. However, it reports errors when a statement within this parfor loop (marked in dFC.m, line 45) calls a function which also contains a parfor loop (marked in multilayerNetFunc.m, line 28). I can run them smoothly if I change either of them into 'for-loop'. I have been trying to find the solution by google and looking up the information in this community. But haven't found the right tips.
I really need these two parfor loops stay in position or it will be a week-long process for my computer.
Wish somebody could help me to figure out the solution!
Thanks!
ps: The two scripts have been attached to this post.
  댓글 수: 7
Yovan Ho
Yovan Ho 2020년 2월 21일
Ok~ Thank you very much! I'll see what I can do to upload the runable version. Sorry, I didn't realize this is necessary. The original code needs to call a couple of neuroimaging processing packages. I'll try to replace the input with modelling data and provide the code later. I really hope someone could help me to solve this problem! Thanks!
Yovan Ho
Yovan Ho 2020년 2월 21일
Hi
I have been struggling to make the parfor-loops in dFC.m & multilayerNetFunc.m feasible. But haven't found the solution yet. I have attached the runable version of my code with this post. However, this community doesn't allow to upload packages, I am not sure if without the complete package-(genlouvain:http://netwiki.amath.unc.edu/GenLouvain/GenLouvain) the major script dFC.m still can run smoothly. Nevertheless, I still wish somebody could help me to solve this problem! Thanks!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by