Error when generating code with Matlab Coder - Struct contents reference from a non-struct array object.
显示 更早的评论
I want to use the Matlab Coder for a project. Before that I wanted to run a small test, to see how the Matlab Coder works.
Therefore I wrote this function:
function x = test2(y)
x = 10*y;
end
When using the Matlab Coder for the function I can autodefine the Input Types and the "Check for Issues" works also fine.
When I want to gernerate the Code (with the default settings), there is an error "Build failed. Please review logged errors".
In the Matlab Command Window there are the following errors:
Struct contents reference from a non-struct array object.
Error in codeUnifiedProject
Error in codeUnifiedProject
Error in emlcprivate
I just can't find the issue. Can anybody help me with that?
Also, I tried the same thing at my university. There it worked perfectly fine. Could there be an issue with my license? I checked it with "ver" and it says
MATLAB Coder Version 3.2 (R2016b)
2 个评论
Mukund Sankaran
2020-11-20
Hi Lara. Can you please share how you autodefined your inputs ? I tried something like "test2(5)" and proceeded with the rest of the steps in the Coder app and the build succeeded.
Is the error you posted all that you see in the MATLAB Command Window or is there more ?
Also if you try to do the same thing using the codegen command instead of the app, does the build succeed ?
eg: codegen test2 -args 5
Lara Rup
2020-11-22
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!