Generating code for a single element array
Show older comments
We have a model that interfaces to a legacy variable that is defined as a single element array. The variable's definition comes from a legacy header file, thus we have created our input data object as a Simulink.Signal using the ImportFromFile storage class.
If I set the signal Dimensions to 2 and use a demux or Selector to select the 1st element I get the correct generated code, something like:
temp = mySingleElementArray[0];
However, if I give it a dimension of 1 (which is what it should be) then it is treated as a scalar; even if I put a demux or Selector on the signal. So the generated code is:
temp = mySingleElementArray;
Which loads the address of the array into temp.
How do I define the input signal object so the code treats this variable correctly?
Accepted Answer
More Answers (0)
Categories
Find more on Simulink 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!