Is there a way to count all connections between blocks in a Simulink model including masked subsystems?
I am currently using the following code which seems to only get me the connections within non-masked subsystems.
lineHandles = find_system(modelName,'FindAll','on','type','line');
lineDim = size(lineHandles);
lines = lineDim(1,1);
count = 0;
for k = 1:lines
dst = get_param(lineHandles(k),'DstBlockHandle');
if any(dst==-1) || ismember(-1, dst)
dst_names = get_param(dst,'Name');
count = count + 1;
Any help or pointers would be greatly appreciated!