Error during sample generation of java pacakage using library compiler

I am trying to use the library compiler to generate a java package for matlab functions. And I select all the functions with an existing sample.
But I am facing the below error in the PackagingLog.html and no files are generated in xxxx/for_redistribution_files_only\samples.
Packaging...
Failed to generate sample for "xxxx\sample script.m": All inputs must be assigned to a variable.

답변 (1개)

Please confirm that all inputs are defined in the sample script.
For example,
addmatrix.m (to be compiled as Java package)
function out = addmatrix(in1, in2)
out = in1 + in2;
end
addmatrixWithClearSample2.m (sample m file which calls addmatrix) should contain all inputs variables (in1 and in2, in this case).
in1 = 0; % Initialize in1 here
in2 = 0; % Initialize in2 here
out = addmatrix(in1, in2);

댓글 수: 4

I am able to run the sample script without any issues in Matlab. When I am using for java packaging only I am facing this issue. Is it possible to debug which variable is causing this issue ?
How about trying "Create New Sample" and compare it to the existing sample m file?
Thank you its solved.
After comparing one of the input is directly used in the function call instead of assigning it to the variable.
So, the issue got soved after defining all the inputs in the variables

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

카테고리

도움말 센터File Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

CHV
2021년 7월 8일

댓글:

2021년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by