function rthosts_add

% Create a new real-time host environment collection object
rthosts_obj = simwb.rthosts
% Add a new default real-time host environment object to the collection
rthosts_obj.add
% Create a new real-time host environment object
rthostenv_obj = simwb.rthostenv
% Customize the real-time host environment by changing the name and IP
rthostenv_obj.Name = 'RedHawk1'
rthostenv_obj.RTHostNameorIP = '192.168.0.10'
% Add this custom real-time host environment to the collection
rthosts_obj.add(rthostenv_obj)
rthosts_obj = 

  simwb handle

  Properties:
    NumHosts: 0



ans = 

  simwb handle

  Properties:
    NumHosts: 1



rthostenv_obj = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'DefaultName'
    RTHostNameorIP: '127.0.0.1'



rthostenv_obj = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk1'
    RTHostNameorIP: '127.0.0.1'



rthostenv_obj = 

  simwb.rthostenv handle
  Package: simwb

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



ans = 

  simwb handle

  Properties:
    NumHosts: 2