I have a simulation for which I log several signals and among them there are some with a size greater than 1.
In the Simulation Data Inspector the signals are grouped according to the Data Hierarchy and this allows me to see the multidimensional signals grouped together but with the opportunity to read each individual "channel". (Settable from the gear in the upper right of the Run window under "Group" in the "Then by" field but also from scripts as shown below.)
My goal is to handle all the signals from scripts, which is why I wrote the following script (MATLAB 2019a):
Simulink.sdi.setTableGrouping('DataHierarchy');
runIDs = Simulink.sdi.getAllRunIDs;
run = Simulink.sdi.getRun(runID);
for i = 1:run.SignalCount
signal = getSignalByIndex(run,i);
signal_name_1 = signal.Name
SignalIDs = run.getSignalIDsByName('MultiDimSig')
signal_name_2 = run.getSignal(SignalIDs(i)).Name
Given a multidimnsional signal logged with the name 'MultiDimSig' with dimension N the above script print:
signal_name_1 = MultiDimSig(1,1)
signal_name_1 = MultiDimSig(1,2)
signal_name_1 = MultiDimSig(1,N)
signal_name_2 = MultiDimSig
signal_name_2 = MultiDimSig(1,1)
signal_name_2 = MultiDimSig(1,2)
signal_name_2 = MultiDimSig(1,N)
Ultimately the problem I encounter is that by loopping with the index I do not find the MultiDimSig multidimensional signal but only its 'channels' whereas by doing a name search and taking the handle of the signal from the ID it is possible to directly take the handle of the multidimensional signal.
This seems to suggest that run.SignalCount is less than the number of IDs available in the run