Error when generating code with Matlab Coder - Struct contents reference from a non-struct array object.
Show older comments
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 Comments
Mukund Sankaran
on 20 Nov 2020
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
on 22 Nov 2020
Answers (0)
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!