Non-Scalar Structure with Different numels as Parameter in a MATLAB Function Block
조회 수: 4 (최근 30일)
이전 댓글 표시
I'm implementing a supervisory control function in a SimEvents model using a Matlab Function block wrapped in a Simulink function. It will be called by several custom entity servers to transfer data from a "grand plan" into the attributes of SimEvents entities. The function will manage the plan, recording dispatch status etc. in the same persistent structure that contains the data.
I want to import the initial grand plan from the base workspace as a parameter to the MATLAB function block. I have met most of the constraints for codegen in my code, but I am stuck on the data type constraint, which is only satisfied if all substructures have the same size. My structure is in the form of buckets and packets:
>> numel(bucket(1).orepacket)
ans =
202
>> numel(bucket(2).orepacket)
ans =
204
My baseline assumption is that I will need to pad the orepacket substructure in the workspace so that all buckets have the same number of orepackets. Is there a better way to deal with this? In the Ports & Data Manager, the parameter is tunable but the "variable size" checkbox is greyed out.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!