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