The value returned from getNumInputsImpl method must be a constant value. But the Value is immutable
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
i get the following error when generating code:
The value returned from getNumInputsImpl method must be a constant value.
Properties used in calculating this value must be Nontunable.
The error occurred for MATLAB System block 'SiL_LUT_1D/MATLAB System1'.
The method:
function num = getNumInputsImpl(obj)
num = obj.Approx.numInputs + 1; % input
end
The propertie numInputs of Approx(ValueClass):
properties (SetAccess = immutable)
numInputs = 0;
end
And obj.Approx is a nontunable Property of the System block. So for my understanding, this value can't change in anyway and should be interpreted as a constant value. Any suggestion on a fix or workaround?
답변 (2개)
Honglei Chen
2020년 2월 26일
You said numInputs is nontunable, did you try to use Nontunable in the property defintion? Like
properties (Nontunable)
numInputs = 0
end
HTH
댓글 수: 13
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!