The source code for the parfor-loop could not be found

70 visualizaciones (últimos 30 días)
John
John el 30 de Sept. de 2022
Comentada: Walter Roberson el 22 de En. de 2023
Hi. I'm using the parfor in order to change some labels name:
Data = cell(1, length(DirList));
numberOfDbExamples = length(DirList);
parfor k = 1:numberOfDbExamples
Data{k} = load(fullfile(Folder, DirList(k).name));
[newLabelNames, newMask] = changeLabelNames(Data{k}.labelNames, Data{k}.mask);
Data{k}.labelNames = newLabelNames;
Data{k}.mask = newMask;
end
I get this error:
The source code (C:----) for the parfor-loop that is trying to execute on the worker could not be found.
Caused by:
Undefined function changeLabelNames for input arguments of type table.
Error using remoteParallelFunction
Do you have an idea of how fix it?
  3 comentarios
John
John el 30 de Sept. de 2022
The function is stored as changeLabelNames.m and it is located in the same folder of the script.
Mehdi
Mehdi el 20 de En. de 2023
can you explain how you solved this problem? I faced similar error!

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de Sept. de 2022
  6 comentarios
Walter Roberson
Walter Roberson el 20 de En. de 2023
@Mehdi I just noticed your https://www.mathworks.com/matlabcentral/answers/1897595-why-receive-error-integrand-output-size-does-not-match-the-input-size?s_tid=srchtitle in which you are expecting that your function might return a constant and so not automatically vectorized by matlabFunction . There are better ways of dealing with that situation.

Iniciar sesión para comentar.

Más respuestas (1)

John
John el 21 de En. de 2023
I did something similar to what Walter mentioned, but I don't remember exactly.

Categorías

Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by