Using RTW to generate reusable functions with different parameters
Show older comments
Hi all, I hope this isn't too dumb of a question for this newsgroup as I usually enjoy lurking around.
My question center's around RTW and the auto generation process.
I'm currently using RTW in 2007b and have lot of similar subsystems in my model, similar enough such that the only thing different is the parameter's passed to them (in integration systems it's the saturation limits, in deadzone/relay systems it's limits to trigger these effects).
For example, I have four discrete integration subsystem with the same surrounding blocks, but each of the four integrators themselves have different saturation limits.
I'm aware that if the subsystem's were identical, one could simply force them to be atomic and classify them as reusable functions (or auto) to create one function in which each of the four instances call it. However, if something small, like the saturation limits on the discrete integrator for example, are different is it possible to still create one function to be used in each of those instances but have the limits be variables that get passed actual values from the function call?
I've come up with a few ways to trick the auto generator to do this on a case by case basis, but was wondering if there was a cleaner way to do it.
I appreciate the comments!
Accepted Answer
More Answers (0)
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!