From: Adam Chapman on
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
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
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