Generating code for a single element array
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!