Prev: Matlab 7.0 R14 problem in Windows 7 64-bit
Next: Possible Issue with Jan Simon's "Shuffle" Program
From: Adam Chapman on 13 Jul 2010 06:24 I'm trying to use the "set_params" function to alter the value in a gain block in simulink. I've read it won't work unless I load the model first, so I'm trying to use the "load_system" function now. When I have this subsystem open in simulink, the file address at the top of the window reads something like: "Big model/subsystem1/subsystem2" I can't seem to acces the submodels with load_system or set_params. I get an "invalid simulink object name" What am i doing wrong?
From: Adam Chapman on 13 Jul 2010 06:29 On Jul 13, 11:24 am, Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote: > I'm trying to use the "set_params" function to alter the value in a > gain block in simulink. > > I've read it won't work unless I load the model first, so I'm trying > to use the "load_system" function now. > > When I have this subsystem open in simulink, the file address at the > top of the window reads something like: > > "Big model/subsystem1/subsystem2" > > I can't seem to acces the submodels with load_system or set_params. > > I get an "invalid simulink object name" > > What am i doing wrong? load_sys('C:\Bigmodel') works, but load_sys('C:\Bigmodel\submodel') gives an error. how can I access the submodel in this way?
From: checker on 13 Jul 2010 19:21 On Jul 13, 3:29 am, Adam Chapman <adamchapman1...(a)hotmail.co.uk> wrote: > On Jul 13, 11:24 am, Adam Chapman <adamchapman1...(a)hotmail.co.uk> > wrote: > > > > > I'm trying to use the "set_params" function to alter the value in a > > gain block in simulink. > > > I've read it won't work unless I load the model first, so I'm trying > > to use the "load_system" function now. > > > When I have this subsystem open in simulink, the file address at the > > top of the window reads something like: > > > "Big model/subsystem1/subsystem2" > > > I can't seem to acces the submodels with load_system or set_params. > > > I get an "invalid simulink object name" > > > What am i doing wrong? > > load_sys('C:\Bigmodel') works, but load_sys('C:\Bigmodel\submodel') > gives an error. > > how can I access the submodel in this way? Your submodel is really part of your bigModel...you don't need to load the submodel. To set the param, open the model using open_system and then simply use the set_param('model\submodel\blockname',paramname,value) syntax. For example: set_param('untitled/Subsystem/Constant','Value','3') -Chris
|
Pages: 1 Prev: Matlab 7.0 R14 problem in Windows 7 64-bit Next: Possible Issue with Jan Simon's "Shuffle" Program |