function rtobj_getEnv

% 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
% Get the environment with name RedHawk1
env1 = rthosts.getRTEnv('RedHawk1')
% Create a new real-time host object and link it to the RedHawk1
% environment
rtobj1 = simwb.rtobj('RedHawk1')
% Get the environment assocaited with real-time object rtobj1
env2 = rtobj1.getEnv
% Compare the 2 environments
isequal(env1,env2)
rthosts = 

  simwb handle

  Properties:
    NumHosts: 3



ans = 

    'RedHawk1'
    'RedHawk2'
    'RedHawk3'


env1 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk1'
    RTHostNameorIP: '192.168.0.10'



rtobj1 = 

  simwb.rtobj handle
  Package: simwb

  Properties:
    RTHostName: 'RedHawk1'
     Connected: 1
     RTWStruct: [1x1 struct]



env2 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk1'
    RTHostNameorIP: '192.168.0.10'



ans =

     1