Undefined function or variable 'matscale'.
2 ビュー (過去 30 日間)
古いコメントを表示
hello everyone, I have a question that my matlab code is packaged into Java code, when I try to test the packaging code(.jar)
error as: Undefined function or variable XXX(.mexw32 file ).
thank you very much
0 件のコメント
回答 (1 件)
Jack
2023 年 3 月 30 日
The error message you are seeing suggests that the MEX file for the MATLAB function XXX is not included in the JAR file.
When packaging MATLAB code into a JAR file using the MATLAB Compiler, you need to ensure that all the required files, including MEX files, are included in the JAR file. This can be done using the mcc command line option -a to specify additional files that need to be included in the JAR file.
To include the MEX file for the XXX function in the JAR file, you can use the following command in MATLAB:
mcc -m yourMainFunction -a XXX.mexw32
Replace yourMainFunction with the name of your main MATLAB function that you want to package, and replace XXX.mexw32 with the name of the MEX file for the XXX function.
After running this command, you should see the MEX file included in the JAR file generated by the MATLAB Compiler. Make sure to use the updated JAR file in your Java application and try running it again.
If the issue persists, you can try adding any other required files or directories to the JAR file using the -a option as needed.
4 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!