Parfor in Parallel Computing

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?

Respuestas (1)

Edric Ellis
Edric Ellis el 21 de Abr. de 2021

0 votos

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.

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Abr. de 2021

Respondida:

el 21 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by