How to get data from inside PARFOR loop

I have defined a zero matrix which its elements is determined inside a PARFOR loop. I want to stop running of the program and obtain the values calculated until now. Is that a way to obtain those elements from inside of the PARFOR loop?

2 件のコメント

Rik
Rik 2018 年 3 月 7 日
For debugging, it is generally better to start with for instead of parfor, because precisely what you're trying to do here is difficult. I don't know if it is impossible, but that wouldn't surprise me.
Adam
Adam 2018 年 3 月 7 日
You can probably add a temporary instruction to save the matrix to file given certain conditions, but unless you have a problem that only occurs in a parfor loop and not in a for loop it is not really worth the effort.
I guess you could also just spew its contents out to command window when some condition or other is met, although creating such a condition is trickier in a parfor loop than a for loop since things are not necessarily happening in contiguous order.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel for-Loops (parfor) についてさらに検索

質問済み:

2018 年 3 月 7 日

コメント済み:

2018 年 3 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by