Can a bus be an IN/OUT variable with partial assignment in the resultant generated code
显示 更早的评论
How do you make the Simulink generated C Code update a single item from a bus without re-assigning the whole bus?
I have a model which takes in a bus with many elements and updates a single entry in the bus which is then output. The output is routed to the next model block for additional computations.
I am trying to compile this atomic model into a stand-alone ERT library. I setup the input and output parameters to be pass-by-reference but can't find anything that would let the generator treat the input and output variables as one.
When the generated *_step function ends, it assigns all of the output entries to the input values which is essentially:
(*pParam) = (*pParam);
I am trying to get Matlab to write-back the computed value into the input bus for it to be sent on its merry way.
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!