- Function not on path: Ensure all functions are on the MATLAB path during compilation. Test your app or function before you compile it.
- P-File Dependencies: Without the M-file source code, dependency analysis cannot detect dependencies for P-files. The tool mentioned in this MATLAB answer can help.
- String arguments: Functions used in strings passed to 'feval', 'eval', 'evalc', or as ODE solver arguments cannot be located by dependency analysis.
- Callback Strings: MATLAB Compiler does not look for functions in callback strings. Change the string reference to your function to a function handle.
Why do I get an "Unrecognized function" error when I run my MATLAB Compiler deployed standalone application?
7 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2024-8-31,0:00
编辑: MathWorks Support Team
about 11 hours 前
I wrote MATLAB code or created an app in AppDesigner that runs without issues in MATLAB Desktop.
When I compile the app with MATLAB Compiler and deploy it, I get errors such as the following when I run the standalone application:
Unrecognized function or variable 'myFuncName'.
Undefined function or variable 'myFuncName'.
Reference to unknown function 'function_name' from FEVAL in stand-alone mode.
Why do I get these errors when running the compiled version of my application but not when I run it from MATLAB Desktop?
采纳的回答
MathWorks Support Team
2024-8-31,0:00
编辑:MathWorks Support Team
about 11 hours 前
When you encounter an "unrecognized function", "undefined function", or "unknown function" error in a compiled MATLAB application, it typically indicates missing dependencies during the compilation process.
Common causes include:
To include any function dependencies explicitly, you can add %#function pragma statements to your code:
Refer to the "Callback Problems Due to Missing Functions" section on the following page for further details, examples, and workarounds for missing dependencies:
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!