Simulink: How can I find the where the signal dimensions of a signal are defined?

11 views (last 30 days)
Hello,
I would like to know if there is a way to find the block/port/... that defines the signal dimensions of other signals 'downstream' (with the -1 setting). I have quite a big model with some large feedback loops and I'm unable to find, in one of these loops, where the signal dimension is set.
Ultimatelly, what I want to do is to convert a vector from a two-dimensional (2-D) signal -[3x1] as specified by simulink- into a one-dimensional (1-D) signal -(3) as specified by simulink-.
I know I can introduce a reshape block, but I would like to trace the origin of the issue if possible.
Thank you.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 10 Jan 2024
Select your signal, find its source block where the dimension of this signal is specified as -1. There might be multiple input signals or parameters that could have impact on the dimension of your signal. For example, a 1x1 signal goes through the Gain of [1 2 3] would become a 1x3 signal. You have to trace each of those signals or parameters to find the critical one.
In general, in Simulink, the signal dimenstion of 1x3 and 3x1 are inter-changable but it would be better to define it as [3], instead of [1,3] or[ 3,1], if it is specifically specified somewhere.
  2 Comments
Ernesto Barbazán
Ernesto Barbazán on 10 Jan 2024
Thank you Fangjun for your answer,
I'm not entirely sure if I explained my self clearly since you say: "find its source block where the dimension of this signal is specified as -1." I mean so because thats how I would prefer to have all blocks defined, with the -1. However, the problem that I have is that somewhere in the model there is a block stating [3x1] that I can not find.
I've been using the 'Highligh signal to source/destination options' and temporarily placing some reshapes to narrow down the search. That way I've found some of these block/ports enforcing the [3x1], yet I have not found all of them. It's worth mentioning that the problem may not be with the 'upstream' blocks/ports but also 'downstream' as shown in the next image:
I was hoping there was some kind of way to find the 'parent' for the signal dimensioning, like maybe looking to some property of a block with those dimesions using the 'get_param' function, or maybe searching for all block/ports in the model with a [3x1] signal (also programatically)
Fangjun Jiang
Fangjun Jiang on 10 Jan 2024
Dimension 3x1 and 3 are not the same in Simulink. Whereever in your model it is specified as 3x1, change it to be 3.

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!