I'm using Simulink's Legacy Code Tool to generate an S-Function block driver library from legacy C device drivers for an embedded target.
Driver blocks are generated iteratively and end up in the library target_LCT_sfun_drivers by way of LCT's slblock_generate
sub-command using a MATLAB script, eg:
legacy_code('slblock_generate', lctSpecs, 'target_LCT_sfun_drivers')
When the script finishes, target_LCT_sfun_drivers holds all my driver blocks, but they are all stacked upon one another.
What can I add to the script that distributes the blocks programmatically, to avoid manually dragging them off of the 'stack'?