Discussion:
simulink model workspace evalin
(too old to reply)
John Reilly
2008-08-29 16:37:03 UTC
Permalink
hi,

in my mask parameter callback handler, i am using

hws = get_param(bdroot, 'modelworkspace')

to get a handle to the Simulink.ModelWorkspace object. then
i use

value = hws.evalin(get_param(gcb, 'p'));

to get the actual numeric value of the parameter p. when i
execute this command, the model window indicates (with the
asterisk) that the model has changed. when it hasn't. i'm
not changing anything; just reading.

is there a way to get the numeric value without the model
thinking it has changed?

i'm using r2007b.

thanks.

reilly.
Phil Goddard
2008-08-31 17:18:01 UTC
Permalink
Since the evalin could in general contain any command,
including ones that indeed do create/delete data in the
workspace, it's not completely unreasonable for Simulink to
be careful and flag the model as changed.
Although I agree that in this case nothing has changed and
perhaps it could be smarter.

How about just putting
save_system(bdroot)
after your evalin so that the model gets saved?

Phil.
John Reilly
2008-09-02 12:41:02 UTC
Permalink
Post by Phil Goddard
Since the evalin could in general contain any command,
including ones that indeed do create/delete data in the
workspace, it's not completely unreasonable for Simulink to
be careful and flag the model as changed.
Although I agree that in this case nothing has changed and
perhaps it could be smarter.
How about just putting
save_system(bdroot)
after your evalin so that the model gets saved?
Phil.
Thanks, Phil. now that you mention it, it does make since
to flag the model as dirty.

the only problem with automatically saving is that the
timestamp of the file would change and that would throw off
my version control system...

reilly.

Loading...