如何找出 Simulink 模型中存在的所有不同块类型?

How to find out all the different blocktyp pesent in a Simulink model?

有没有办法找出模型中涉及的所有块类型,我想它应该可以 get_parameter ? 谢谢

find_system开始获取所有方块。 为每个获取 BlockType,最后应用 unique 以在结果中只获取每个类型一次。

%get the path to all blocks
all_blocks=find_system('untitled','lookundermasks','all','type','block')
%get the block type
unique(get_param(all_blocks,'BlockType'))

对于 lookundermasks 选项,请务必选择您想要的选项。