1

I have a library with numerous S-function Builder blocks.

If I want to regenerate .mex files (say, on a different platform),
the standard method would be to:

  • Go to every S-function builder block
  • Open its S-Function Builder Wizard
  • Click Build

Is there a method to automate this process, such that
every S-Function Builder block within a library (including all subsystems),
is rebuilt?

kando
  • 441
  • 4
  • 16

1 Answers1

2

That is possible:

blkNames = find_system(bdroot,'lookundermasks','all','BlockType','S-Function');
for blkIdx = 1:numel(blkNames)
  blkHandle = get_param(blkNames{blkIdx}, 'Handle');
  appdata = sfunctionwizard(blkHandle,'GetApplicationData');
  appdata = sfunctionwizard(blkHandle,'Build',appdata);
end

I don't have any reference or documentation, just read this question shortly after reading your question and verified the code is actually working.

Community
  • 1
  • 1
Daniel
  • 36,610
  • 3
  • 36
  • 69