Hello,
I'm trying to use setparam command to modify blocks in a Simulink Real-Time model through a GUI built in App Designer. I was able to change a constant block value in the "first layer" of the Simulink model by using a command like:
setparam(tg,'Constant','Value',1)
At the same time, when trying to set similar constant blocks within subsystem blocks (so lower layers of the Simulink model), I'm getting "invalid parameter" error. The command I'm using is pretty much similar but providing the path to the Constant block. Something like this:
setparam(tg,'Layer1/Layer2/Constant','Value',1)
To be honest, I was able to change parameters at the 2nd level, but not deeper than that.
Is there some sort of limitation in using this setparam command? I couldn't find any reference online but maybe you can help here.
Like, is the problem if the layer name contains spaces (e.g. "Layer 1" instead of "Layer1")? Or maybe it's really limited to one level of nesting?
I'm on Matlab 2020a.
Thanks for any help in advance! :)