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

18 views (last 30 days)
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;

Accepted Answer

Gowthami
Gowthami on 27 Jan 2023
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 Comment
Alexi
Alexi on 27 Jan 2023
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink Environment Customization in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!