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 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by