function ret = createSource(hw,sourceName,varargin)
%CREATESOURCE Returns a source object for a given hardware board.
%
%createSource(hw) returns a list of all available source objects for hardware
%object hw.
%
%createSource(hw,sourceName) returns a source object corresponding to
%sourceName.
%
% Examples:
%
% z = createHardwareObject(<Hardware board name>, 'hostname', '192.168.0.1', 'username', 'root', 'password', 'root');
% listSources(z)
%
%     ans = {'UDP Receive'} {'TCP Receive'} {'AXI Stream Read'} {'AXI Register Read'}
%
% src = createSource(z,'AXI Stream Read');

% Copyright 2016-2018 The MathWorks, Inc.
if nargin == 1
    ret = getAvailableSources(hw);
else
    ret = getSource(hw,sourceName,varargin{:});
end
end