Data 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

16 ビュー (過去 30 日間)
While I do not get the error in the m file, I am getting it in simulink. How can I fix the error. Thank you.
uk=zeros(1,m*ni);
ns=1;
nb=1;
for n=1:1:m*ni
uk(n)=-w0*cos(gama(nb))+ (w1-k1*w0)*cos(gama(nb)) * (ef*cosd(Azi(nb))+seg_mid(ns)*cosd(Azi(nb)+omega(nb))) + ((D_ws+K1_y*D_w0)*cos(gama(nb))) * (ef*sind(Azi(nb))+seg_mid(ns)*sind(Azi(nb)+omega(nb)));
if ns==m
nb=nb+1;
ns=0;
end
ns=ns+1;
end
u=uk;

採用された回答

Gowthami
Gowthami 2023 年 1 月 27 日
Hi,
It is my understanding that you are facing an issue with the 'Variable Size' in the Simulink model.
I recommend you perform the following changes in the Simulink model:
1. Enable the 'Variable size' checkbox for the output variable in the property inspector.
2. Change the sample time for the scope to discrete to support the variable size signal.
More information on setting the general variable properties - https://www.mathworks.com/help/simulink/ug/_bqlblru.html#bqona5_
  1 件のコメント
Alexi
Alexi 2023 年 1 月 27 日
Thank you for your answer, but I have identified where the error is coming from. The reason for the error is that I understood that the parameters that determine the limit of the for value in the simulink math function must be defined in the math function. I've observed that if I don't recognize this value as function inputs, I keep getting errors.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by