You can get the list of all the Simulink constant blocks in a Simulink model in MATLAB using the following steps:
find_system command to get the handles of all the blocks in the model.Here's the code to implement the above steps:
main.m554 chars21 lines
Note that gcb in the above code represents the current Simulink model that is open in MATLAB. Also, the strcmp function is used to compare the block type with the string 'Constant'.
gistlibby LogSnag