function rtobj_disconnect % Create a new real-time host environment collection object rthosts = simwb.rthosts % Get names of real-time host environments present in the collection rthosts.getRTEnvNames % Create a new real-time host object and link it to the RedHawk1 % environment. % While creating the real-time host object, the object will try to % establish a connection between MATLAB and the Simulation Workbench server % running on the real-time host. rtobj1 = simwb.rtobj('RedHawk1') % You can disconnect MATLAB from the Simulation Workbench server rtobj1.disconnect % Dispaly rtobj1 object rtobj1
rthosts =
simwb handle
Properties:
NumHosts: 3
ans =
'RedHawk1'
'RedHawk2'
'RedHawk3'
Connected to real-time host.
rtobj1 =
simwb.rtobj handle
Package: simwb
Properties:
RTHostName: 'RedHawk1'
Connected: 1
RTWStruct: [1x1 struct]
Disconnected from real-time host.
rtobj1 =
simwb.rtobj handle
Package: simwb
Properties:
RTHostName: 'RedHawk1'
Connected: 0
RTWStruct: [1x1 struct]