function rtuser_usage

% Create a new real-time host environment collection object
rthosts = simwb.rthosts
% Create a new real-time host environment object
rthostenv = simwb.rthostenv
% Customize the real-time host environment by changing the name and IP
rthostenv.Name = 'RedHawk1'
rthostenv.RTHostNameorIP = '10.134.30.181'
% Create a new rtuser object with the username and password
rtuser = simwb.rtuser('admin','nimda')
% Assign the rtuser object to the RTUser property of the real-time host
% environment object
rthostenv.RTUser = rtuser
% Add this custom real-time host environments to the collection
rthosts.add(rthostenv)
% Create the real-time host object connecting to the environment with name
% RedHawk1
rtobj = simwb.rtobj( 'RedHawk1')
% Upon successful connection to the real-time host, retrive the list of
% groups the user has access to
allgroups = rtobj.getEnv.RTUser.Groups
% Assign one of the groups to the real-time host object Group property.
% Any RTDB created or RTW generated code created with this user and this
% group can only be accessed by other users belonging to this group only
rtobj.Group = allgroups{1}
rthosts = 

  simwb handle

  Properties:
    NumHosts: 0



rthostenv = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
              Name: 'DefaultName'
    RTHostNameorIP: '127.0.0.1'
            RTUser: []



rthostenv = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
              Name: 'RedHawk1'
    RTHostNameorIP: '127.0.0.1'
            RTUser: []



rthostenv = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
              Name: 'RedHawk1'
    RTHostNameorIP: '10.134.30.181'
            RTUser: []



rtuser = 

  simwb.rtuser handle
  Package: simwb

  Properties:
       UserName: 'admin'
       Password: '*****'
         Groups: {}
    EncodedPass: 'K/U46iHyap8Cc'



rthostenv = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
              Name: 'RedHawk1'
    RTHostNameorIP: '10.134.30.181'
            RTUser: [1x1 simwb.rtuser]



ans = 

  simwb handle

  Properties:
    NumHosts: 1



rtobj = 

  simwb.rtobj handle
  Package: simwb

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



allgroups = 

    'default'
    'testgroup2'
    'testgroup1'


rtobj = 

  simwb.rtobj handle
  Package: simwb

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