- You cannot place a GLOBAL declaration directly inside a PARFOR loop
- The MATLAB workers executing the body of your PARFOR loop are separate MATLAB processes, and the values of global variables are not synchronised
does parfor support global variables?
7 ビュー (過去 30 日間)
古いコメントを表示
I want to use global variables in the functions run in parallel using parfor. Is it possible?
0 件のコメント
回答 (1 件)
Edric Ellis
2012 年 3 月 26 日
There are two restrictions.
So, while you can use GLOBAL variables within functions called from the body of your PARFOR loop, they probably do not behave as you wish.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!