Parfor in Parallel Computing

조회 수: 1 (최근 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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by