MATLAB Answers

Yakov M
0

Simulink Mask initialization command and RuntimeObject

Asked by Yakov M
on 4 Oct 2019
Latest activity Edited by Yakov M
on 4 Oct 2019
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 Comments

Sign in to comment.

Tags

0 Answers