フィルターのクリア

Why do I get an "Unrecognized function" error when I run my MATLAB Compiler deployed standalone application?

7 ビュー (過去 30 日間)
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
MathWorks Support Team 2024 年 8 月 31 日 0:00
編集済み: MathWorks Support Team 約9時間 前
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:
  • 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.
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 件)

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by