Simulink cannot propagate the variable-size mode from the input
53 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Kaustubha Govind
2013 年 4 月 30 日
You need to look at the list of Simulink blocks that support variable-size signals and implement your model using one of those blocks.
回答 (1 件)
Will Forfang
2013 年 4 月 30 日
編集済み: Will Forfang
2013 年 4 月 30 日
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
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!