concatenate inside parfor loop

24 ビュー (過去 30 日間)
Lalo Landa
Lalo Landa 2019 年 1 月 7 日
回答済み: Steven Lord 2019 年 1 月 7 日
In my code, I use parfor to call a function, and then concatenate the result to the others in a matrix:
parfor i=1:num+1
result=function1(i);
X=[X,result];
end
The thing is that X is ordered, just like i need. Parfor always works like that and concatenates in order? or is pure luck?

回答 (1 件)

Steven Lord
Steven Lord 2019 年 1 月 7 日
See this documentation page for the answer to your question.

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by