MATLAB System block error: The input to coder.const cannot be reduced to a constant
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Guilherme T Silva
am 15 Okt. 2016
Beantwortet: Guilherme T Silva
am 15 Okt. 2016
I'm trying to build a system block with a dynamic number of inputs. I'm able to choose the number of inputs through a dialog and it updates the number of inputs, but when I simulate the model I get: "The input to coder.const cannot be reduced to a constant".
I'm using the following code:
function num = getNumInputsImpl(obj)
% Define total number of inputs for system with optional
num = obj.NumInputs;
end
I can't simply change it to interpreted execution, because I'm planning to use that system block to generate C code. Any thoughts?
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Naming Conventions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!