Simulink Coder - pass by reference
1 view (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Kaustubha Govind
on 20 Nov 2012
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.
0 Comments
See Also
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!