%% Create ROS Publisher with rospublisher and View Properties
% Create a ROS publisher and view the associated properties for the rospublisher object. Add a subscriber and view the updated properties.
% Start ROS master.

rosinit

%
% Create a publisher and view its properties.

pub = rospublisher('/chatter','std_msgs/String');

topic = pub.TopicName
subCount = pub.NumSubscribers

%
% Subscribe to the publisher topic and view the changes in the NumSubscribers property.

sub = rossubscriber('/chatter');
pause(1)

subCount = pub.NumSubscribers

%
% Shut down the ROS network.

rosshutdown

%
% Copyright 2015 The MathWorks, Inc.
%