Variable size signal for integrator in Simulink

조회 수: 7 (최근 30일)
Sam136
Sam136 2019년 5월 27일
답변: Walter Roberson 2024년 9월 5일
In my model (simplified version is shown below), the output size of matlab function is determined by the input. I changed the output size to "Variable size" with the upper and lower limits. Without the integrator the model works, but when I add integrator to the output of function I get this error:
"Simulink cannot propagate the variable-size mode from the output port 1 of 'untitled/MATLAB Function' to the input port 1 of 'untitled/Integrator'. This input port expects a fixed-size mode. The variable-size mode originates from 'untitled/MATLAB Function'. Examine the configurations of 'untitled/Integrator' for one of the following scenarios: 1) the block does not support variable-size signals; 2) the block supports variable-size signals but needs to be configured for them."
I know the variable-size signal is not supported by the integrator block. I am wondering if there is any solution to this issue?
function y = fcn(u)
y = ones(u,1);
2019-05-27 08_51_38-untitled _ - Simulink.png
  댓글 수: 2
Paolo Mastracci
Paolo Mastracci 2020년 10월 3일
Have you solved this problem? I'm experiencing the same issue
Leila Farahani
Leila Farahani 2023년 6월 25일
Have you solved this problem? I'm experiencing the same issue too

댓글을 달려면 로그인하십시오.

답변 (2개)

Rajanya
Rajanya 2024년 9월 5일
I understand that you are passing a variable size input to the integrator block and therefore, Simulink throws the error saying that either the block does not support variable size inputs or needs to be configured for them.
I would like to add a point here that if the block can work for variable size inputs, it can be configured by going to the ‘Explore’ section of the MATLAB function block and checking the ‘variable size’ checkbox with minimum and maximum value bounds.
However, one of the block characteristics of the integrator block is that it currently does not support inputs from variable size signals.
A workaround could be to use ‘Selector’ or ‘Switch’ logic to select the portions of the signals which are necessary at a given time, ensuring the input to the integrator always stays fixed size. You can also make use of ‘Buffers’ to make them store values and process them in batches of fixed size.
Hope this helps.

Walter Roberson
Walter Roberson 2024년 9월 5일
Use an iterator subsystem to loop over the vector elements, integrating one by one.

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by