Clear Filters
Clear Filters

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

1 view (last 30 days)
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 Comments
Yovan Ho
Yovan Ho on 21 Feb 2020
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 on 21 Feb 2020
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!

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!