Simulink cannot propagate the variable-size mode from the input

153 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.
Regards,
  1 Comment
Kaustubha Govind
Kaustubha Govind on 30 Apr 2013
You need to look at the list of Simulink blocks that support variable-size signals and implement your model using one of those blocks.

Sign in to comment.

Answers (1)

Will Forfang
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
if u>.5
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,
-Will
  1 Comment
Mehdi
Mehdi on 30 Apr 2013
Edited: Mehdi on 30 Apr 2013
I did the same but that error persists. My matlab embedded Fcn: function y = fcn(u) %#eml y = zeros(u); http://upload.tehran98.com/img1/sclyplfdeaq2tf3uci3t.jpg take care I have used Matrix Multiply block not simple product. Actually I multiply the Matlab Embedded output by another matrix that comes from a constant block. Any comments?

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!