- Set X and Y to be non-tunable using the 'Edit Data' option from within the MATLAB Function Block.
- Set 'out' to variable-size as suggested by the message. In most cases this will resolve the warning straight away, but there may be other limitations that cause warnings/errors elsewhere in the model, so in general this should be recommended second.
Why are my MATLAB Function block arguments being inferred as variable size?
27 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2020 年 1 月 13 日
回答済み: MathWorks Support Team
2020 年 3 月 30 日
Hi,
I am running into the following error message with a Simulink Model using a MATLAB Function Block.
Data 'out' is inferred as a variable size matrix, while its properties in the Model Explorer specify its size as inherited or fixed. Please check the 'Variable Size' check box and specify the upper bounds in the size field.
It is not clear to me why the matrix is being inferred as variable size. Inside, the MATLAB Function Block, I define out to have a certain, fixed size corresponding to the values of two other parameters defined in the MATLAB Function block, as follows:
>> out = zeros(X,Y);
X and Y are defined as parameters within the MATLAB Function block, but they do not change during the simulation.
Why is the array variable-sized, and how do I resolve this??
採用された回答
MathWorks Support Team
2020 年 1 月 13 日
In this particular case, variables X and Y were defined as Tunable parameters within the MATLAB Function block. This leads to Simulink interpreting the array as variable sized because X and Y could theoretically change during the simulation, even though their values clearly do not change here.
To resolve this, there are two potential solutions:
Other users have encountered the same thing here:
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
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!