jarson 发表于 2009-4-23 14:08:53

Initialize the masked subsystem

We can add the command 'my_test' ( running my_test.m ) by initialization pane ofthe mask editor of the subsystem. But my question is how to add 'my_test' command into the initialization pane by a matlab command line? for example, set_param?

Thanks in advance.

nostalgica 发表于 2009-4-23 16:57:23

set_param(gcb,'MaskInitialization','my_test')

jarson 发表于 2009-4-24 09:36:32

万分感谢呀。找MATLAB的帮助,没有找到,郁闷死了。

jarson 发表于 2009-4-24 14:35:00

set_param(gcb,'MaskInitialization','my_test')
nostalgica 发表于 2009-4-23 16:57 http://forum.simwe.com/images/common/back.gif

再次请教版主, 有disp语句在我的my_test. 我发现set the param of the masked system的时候,同时也执行了一次my_test。我的问题是希望不在MATLAB命令行显示disp语句的内容,当my_test执行的时候?

BTW, 可能你会说去掉my_test 里的disp语句。但my_test还在别的地方用的,我只是希望set_param of the maskInitialization的时候,不显示。

谢谢先!

nostalgica 发表于 2009-4-24 15:48:07

在mytest里加上:
if get_param(gcb,'userdata')==1
disp('...');
else
end


设置时用:
set_param(gcb,'userdata',0);
set_param(gcb,'MaskInitialization','mytest');
set_param(gcb,'userdata',1);

jarson 发表于 2009-4-24 16:14:01

谢谢你。还有别的方法吗?我的例子比较特殊,my_test 是第三方给的,通知API拿到的,所以一般情况下,不改my_test。呵呵!我只是希望不显示disp语句内容当initialize the masked system.

nostalgica 发表于 2009-4-24 16:39:52

没了,要不改mdl源文件吧.

jarson 发表于 2009-4-24 16:51:43

thanks lots.
页: [1]
查看完整版本: Initialize the masked subsystem