Occasionally when creating a SimFunction, SimBiology returns a failure to compile error, what causes this?

조회 수: 4 (최근 30일)
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).

채택된 답변

Arthur Goldsipe
Arthur Goldsipe 2023년 5월 18일
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
Craig Thalhauser
Craig Thalhauser 2025년 6월 11일
Hi Arthur--
I just installed R2025a and am getting this same error whenever I try to create a simfunction or verify a model. I created a simple 2-compartment PK model from the library, loaded it, and see this:
>> pkm = PKModelDesign;
pkc1 = addCompartment(pkm, 'Central', 'DosingType', 'Bolus', ...
'EliminationType', 'linear-clearance', ...
'HasResponseVariable', true);
pkc2 = addCompartment(pkm, 'Peripheral', 'HasResponseVariable', true);
[modelObj, PKModelMapObj] = pkm.construct
verify(modelObj)
modelObj =
SimBiology Model - Generated Model
Model Components:
Compartments: 2
Events: 0
Parameters: 11
Reactions: 4
Rules: 3
Species: 4
Observables: 0
PKModelMapObj =
PKModelMap with properties:
Dosed: {'Central.Drug_Central'}
DosingType: {'Bolus'}
Estimated: {4×1 cell}
Observed: {2×1 cell}
ZeroOrderDurationParameter: {0×1 cell}
LagParameter: {0×1 cell}
--> Error reported from ODE Compilation:
Not enough input arguments.
Arthur Goldsipe
Arthur Goldsipe 2025년 6월 11일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Arthur Goldsipe
Arthur Goldsipe 2025년 6월 11일
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.

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Scan Parameter Ranges에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by