title: Simulink MultiArray message generation to ROS
body: <p>How can I create a publisher that in <strong>Simulink (Matlab R2015A)</strong> that sends an array of floats as a <strong>ROS message</strong> (in ROS Indigo under Ubuntu 14.04)? I should use the <code>BlankMSG</code> block with msg type: <code>std_msgs/Float32MultiArray</code>, a <code>Publish</code> block with the same msg type and my own topic name.</p>
  
  <p>I don't know how to add the vector to the data field on the msg bus. I tired, with a <code>Bus Assignment</code> block where the data input is a constant vector, but I get an error:</p>
  
  <blockquote>
    <p>The Bus input port of the Bus Assignment block 'SubscriberMotorStates/Bus Assignment' does not support an array of buses as a sub-element.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/xz9rO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xz9rO.png" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried in Matlab to send an array and did work by following the <a href="http://www.mathworks.com/help/robotics/ref/rospublisher.html" rel="noreferrer">instructions</a>. </p>
  
  <pre><code>chatpub = rospublisher('/chatter','std_msgs/Float64MultiArray');
  msg = rosmessage(chatpub);
  msg.Data = [1 2 3];
  send(chatpub,msg);
  </code></pre>
  
  <p>So, I can also use in simulink this by implementing a function in an *.m file and use the <code>Interpreted MATLAB function</code> block. </p>
  
  <p>I'm still curious how can I use the intended blocks for array message sending, because it might be better optimized. (I'm going to use in a real application)</p>