anchor.diff:  end
   ----
   
  -The MEX function then parses the first argument for the desired action and calls another function that translates between MEX arguments and the C API. The C API then sends the corresponding message types on ZeroMQ.
  +The MEX code is implemented in a similar way as the ZeroMQ project in that there is a single function implementation (https://bitbucket.org/osrf/haptix-comm/src/a961986b0254a3dbcabcc89ba14f78915d5d968a/matlab/hxgz.c[hxgz.c]) that takes a string as the first argument to execute a corresponding action. The MEX function internally translates the other input arguments according to the action and calls a corresponding function in their C API, which then sends an appropriate message via ZeroMQ. The snippet below shows a simplified example for an action implementation.
   
   [source,c++]
   ----
  
positive.code: end
  ----
  
  Overall, we found that the ROS support toolbox looks very nice and is a great example of how seamless external languages could be integrated with MATLAB. We also really liked that they offered a way to load log files (rosbags).
  
  === Data Distribution Service (DDS)
  
  In 2014 Mathworks also added a https://www.mathworks.com/hardware-support/rti-dds.html[support package for DDS], which is the messaging middleware that ROS 2.0 is based on. It supports MATLAB, Simulink, as 
  
negative.code: lc.publish('COMMAND_CHANNEL', cmd);
  ----
  
  Incoming messages are received by subscribing to a channel and picking up messages from the aggregator's queue. Since Java is limited to a single return argument, the _getNextMessage_ call returns a Java type that contains the received byes as well as the source channel name. The snippet below shows the backing Java code.
  
  [source,java]
  ----
  