You can solve it the following way.
- Enable signal logging for the desired signals (Properties). For
example set the name to custom and
signalone
.
- If you actually don't want to log the signal, set
Limit data points to last
to 1
, so you avoid storing unused data.
- Go to SImulink preferences and enable signal logging, default output name is
logsout
- after simulation you'll get a dataset
logsout
in your workspace
now evaluate this dataset as follows:
% returns data, if data limit is set to 1 it's a coloumn
% vector with just the last value
data = logsout.get('signalone').Values.Data
you can now just use the size of this vector and you know the dimension of the signal
[~,dim]=size(data)
or in one line:
[~,dim]=size(logsout.get('signalone').Values.Data)
If you have a a lot of signals and you want to evaluate them at once, give your signals convenient output-names and use a loop for iterating through a string vector with all your signal names.
As you say you want the dimensions of "all" (are you sure?) signals I think it is more convenient to just check "Enable signal logging" in each signal property and do all further definitions in the Simulink preferences where you have a list to manage all signals.