Simulink Mask initialization command and RuntimeObject
4 次查看(过去 30 天)
显示 更早的评论
Here is code for my mask initialization I want to use it to change the color according to outputs of one of the blocks
systems = find_system(gcb,'LookUnderMasks' , 'on', 'FollowLinks','on', 'SearchDepth', 1,'regexp','on','Name','Multi');
rto=get_param(systems{1,1},'RuntimeObject')
if rto.OutputPort(1).Data == 1
set_param(gcb,'BackgroundColor','red')
else
set_param(gcb,'BackgroundColor','green')
end
When I press OK I get `Error: Dot indexing is not supported for variables of this type`
When I use `keyboard` to debug I get this
K>> rto
rto =
handle
It seems that it can't get the runtimeobject but when I do this while still in debug mode
rto=get_param(systems{1,1},'RuntimeObject');
while debugging I did get it
rto =
Simulink.RunTimeBlock
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!