MATLAB: How to build multiple S-Functions from S-Function Builder at once

s-fus-function

My simulink model contains many S-Functions build by S-Function Builders. But every time I change something, I have to click each S-Function Builder block to re-build. Is there a way I can re-build all the S-Functions of my model at once? (maybe from command window)
Thanks,

Best Answer

You could write MATLAB code that loops over all the S-Function Builder blocks in your model and builds them using the commands listed on this solution: <http://www.mathworks.com/support/solutions/en/data/1-AWIVV1/index.html?product=ML&solution=1-AWIVV1>
You can find S-Function Builder blocks in your model using:
builderBlocks = find_system(bdroot, 'LookUnderMasks', 'all', ...
'BlockType','S-Function', 'MaskType', 'S-Function Builder');