Simulink - Variable Size
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hayden Garmon
am 15 Feb. 2021
Beantwortet: Abhishek Gupta
am 18 Feb. 2021
Within my simulink model I have the following function, which defines my PWM Duty Cycle:
function DutyValue = fcn(u,StepTime,StepSize,StepIncrease)
DutyValue=0;
x=floor(u/StepTime); % Determine Step On or Step Off
if mod(x,2)==0
DutyValue=0;
elseif mod(x,2)==1
DutyValue=StepSize+StepIncrease*(x-1); % Define Step Size if Step is On
end
end
Upon building my model, I yield this error
"Data 'DutyValue' 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."
However, I cannot change the size of the matrix to Varible size, as the subsequent blocks cannot recieve inputs of varible size. I have tried constraining the size of the inputs, which would ensure that the output size is constrained, but that does not work either.
Appreciate any help!
Cheers
HRG
0 Kommentare
Akzeptierte Antwort
Abhishek Gupta
am 18 Feb. 2021
Hi,
Referring to the following resources, which might help you in resolving the issue: -
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Conditional Mean Models finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!