Why am I getting an undefined function handle error when calling parfeval in MATLAB R2024b?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 21 de Jul. de 2025
Respondida: MathWorks Support Team
el 25 de Jul. de 2025
I am encountering a "MATLAB:UndefinedFunction" error with the message, "Undefined function handle" when running a MATLAB script in conjunction with a SimBiology program in MATLAB R2024b. The program performs a set of model fits to experimental data by submitting each model fit to a cluster using "parfeval". The cluster consists of the host computer (running a MATLAB SimBiology Model Analyzer interface and runs the program) and five additional compute nodes. This issue only occurs after the SimBiology program has been run at least once with the parallel pool generated by the cluster. How can I resolve this error?
Respuesta aceptada
MathWorks Support Team
el 21 de Jul. de 2025
To resolve this issue, ensure that all helper functions called within the code are separated into different .M files. Next, pass all these files to the workers by calling the "addAttachedFiles" method in the entry point MATLAB code.
For example:
p = parpool('YourCluster');
addAttachedFiles(p, ["function1.m", "function2.m", "function3.m", "function4.m", "function5.m", "function6.m", "function7.m"]);
0 comentarios
Más respuestas (0)
Comunidades de usuarios
Más respuestas en SimBiology Community
Ver también
Categorías
Más información sobre Perform Sensitivity Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!