ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you are using Matlab 2015a, you should be able to use the Robot Operating System Support in the Robotics System Toolbox. From that page:
Create ROS nodes in MATLAB and Simulink, exchange messages with other nodes on the ROS network, import ROS log files into MATLAB, and generate C++ code for a standalone ROS node.
and
You can develop, test, and verify your robotics algorithms and applications on ROS-enabled robots and robot simulators such as Gazebo and V-REP.
So with Gazebo on one side, Matlab on the other and ROS in the middle, you should be able to do what you described.
For other (older) versions of Matlab this should also be possible, but is a bit more involved.