Simulink Mask initialization command and RuntimeObject

조회 수: 3 (최근 30일)
Yakov M
Yakov M 2019년 10월 4일
편집: Yakov M 2019년 10월 4일
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