Simulink Coder - pass by reference
显示 更早的评论
Heya! I have a question regarding code generation from Simulink Coder:
Within one big Simulink model, does Simulink Coder allow you to pass a large frame of data from one signal processing routine to another signal processing routine using a pointer? If so, how?
I ask because I've got a large simulink model in which multiple signal processing algorithms perform mathematical operations on the same frame of data in a sequential manner - so for efficient C code it would make sense for one signal processing routine to pass a pointer reference to the data to the next signal processing routine.
Thanks!
回答(1 个)
Kaustubha Govind
2012-11-20
0 个投票
Do you mean that each block should perform "in-place" operations? In other words, the output signal reuses the same memory location as the input signal? If so, I think Simulink Coder already tries to do this if Reuse block outputs is enabled on the Configuration Parameters window. However, blocks can opt out of this. For example, an S-function can use ssSetInputPortOverWritable to specify that an input signal buffer can be reused.
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!