Occasionally when creating a SimFunction, SimBiology returns a failure to compile error, what causes this?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Craig Thalhauser
le 18 Mai 2023
Réponse apportée : Arthur Goldsipe
le 11 Juin 2025
Sometimes when I try to create and compile a SimFunction, the following error happens:
Unable to create SimFunction:
--> Error reported from ODE Compilation:
Not enough input arguments.
Caused by:
Error using SimBiology.internal.compile
--> Error reported from ODE Compilation:
Not enough input arguments.
The code file will run in other versions of MATLAB (e.g. I just got this error in R2023a, but it runs fine on R2022b).
0 commentaires
Réponse acceptée
Arthur Goldsipe
le 18 Mai 2023
Hi Craig,
My guess is that this is some sort of bug. But it's hard to say definitively without reproduction steps. If you can consistently reproduce this, can you share the code? I'm assuming you don't want to share it publicly here on MATLAB Answers, so feel free to contact me directly. In general, I encourage folks to report anything that feels like a bug to Technical Support.
-Arthur
2 commentaires
Arthur Goldsipe
le 11 Juin 2025
I'm not able to reproduce this in my R2025a installation. My guess is that this indicates a problem with the installation. So the first idea I have is to try reinstalling to see if the problem reproduces. You could also run "restoredefaultpath" to make sure the MATLAB path hasn't been corrupted.
If the problem continues after a reinstall, then we can try to figure out exactly where/why the error occurs. My general approach to debugging errors is to run "dbstop if error; dbstop if caught;" and then rerunning repro steps. The debugger should then stop at the site of the error. You will likely stop in a P-coded file, so you won't be able to see full details of the code. But if you run "dbstack" you should still be able to see exactly what function and line of code is associated with the error. If you share that info with me, I can cross-reference that with the source. I also recommend saving the current workspace in a MAT file that you can share if needed.
Plus de réponses (1)
Arthur Goldsipe
le 11 Juin 2025
This error was caused by adding a custom folder to the MATLAB path. This folder contained a function that shadowed a MATLAB finction (strjoin), changing the behavior in an unexpected way. The issue was fixed by removing this folder from the path. Another option would be to add the folder to the END of the MATLAB path, to ensure that standard functions never get shadowed.
0 commentaires
Communautés
Plus de réponses dans SimBiology Community
Voir également
Catégories
En savoir plus sur Scan Parameter Ranges dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!