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 个评论

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
Hi Mukund!
To autodefine the inputs i typed: test2(1), y was then defined as double(1x1).
The error I posted was all I could see in the Command Window.
I tried it again today (on a sunday), and it worked fine (with the App and also with the command). But I failed to do the exact same thing multiple times during the week. Is it possible that all the licenses from the license server were blocked during the work days? Is there a way I can find that out if I have the same problem during the week again?

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB Coder 的更多信息

产品

标签

提问:

2020-11-20

评论:

2020-11-22

Community Treasure Hunt

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

Start Hunting!

Translated by