Simulink cannot propagate the variable-size mode from the input
112 views (last 30 days)
My model have Matlab Embedded Fcn. It(MEF) have variable size output. The output connected to a Multiply block. When I run the model the bellow error appeared: Simulink cannot propagate the variable-size mode from the input "From1"(#) of "MMM/Subsystem/Embedded MATLAB Function2"(#18) to the input port 1 of 'example/MMM/Matrix Multiply3'. This input port expects a fixed-size mode. The variable-size mode originates from 'example/MMM/Subsystem/Embedded MATLAB Function2/ SFunction '. Examine the configurations of 'example/MMM/Matrix Multiply3' 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.
It seems Multiply block do not accept variable size data. Help me to fix the problem.
Will Forfang on 30 Apr 2013
Edited: Will Forfang on 30 Apr 2013
The key phrase in your error, i think, is this:
"2) the block supports variable-size signals but needs to be configured for them."
You can right-click the matlab function block, choose explore, and set its output to a "variable size" with upper and lower bounds on its dimension.
Then many blocks will accept it.
I created a custom function whose output dimensions depend on the value of the input:
function y = fcn(u)
y=ones(5); %this creates a 5x5 matrix of ones
y(2,:) = ;
end %The if statement removes the 2nd row of the output if the input>.5
I have this going into a "product" block and then to a "display" block. Both are working fine and I can see the dimensions of the output in the display changing with time. Here is a screenshot of the simulink model and the model explorer with circles around the parameters that you may need to adjust:
Hope this helps,