Parfor in Parallel Computing

1 visualizzazione (ultimi 30 giorni)
FARIS SYAHMI SAMIDI
FARIS SYAHMI SAMIDI il 20 Apr 2021
Risposto: Edric Ellis il 21 Apr 2021
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?

Risposte (1)

Edric Ellis
Edric Ellis il 21 Apr 2021
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.

Categorie

Scopri di più su Parallel for-Loops (parfor) in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by