Parfor in Parallel Computing

2 ビュー (過去 30 日間)
FARIS SYAHMI SAMIDI
FARIS SYAHMI SAMIDI 2021 年 4 月 20 日
回答済み: Edric Ellis 2021 年 4 月 21 日
Hi, i wish to use parfor in my code. However, i use run(function) to initialy execute which cant be use in parfor loop. Is there any other alternative to "run" command to work with parfor?

回答 (1 件)

Edric Ellis
Edric Ellis 2021 年 4 月 21 日
The run function does not work with scripts containing parfor loops. Simply invoke the script directly by name. If the script is in a different directory, change directory there first. Perhaps something like this:
scriptName = '/some/path/to/myscript.m';
scriptDir = fileparts(scriptName);
cd(scriptDir);
myscript % just call directly.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by