title: Append a vector to a Matrix
body: <p>I have a Matrix </p>
  
  <pre><code> DataSet(1000,400)
  </code></pre>
  
  <p>I wish to copy each row into a final matrix initially declared as</p>
  
  <pre><code>FinalDataSet=[]
  </code></pre>
  
  <p>The rule I followed for copying is as follows which is based upon user input</p>
  
  <pre><code> For any row i in "DataSet"
        if user enters a character X
            Add to FinalDataSet the vector (X,All Elements of DataSet(i))
        else do nothing
  </code></pre>
  
  <p>I implemented the following code for the above</p>
  
  <pre><code>n=size(DataSet,1);
  for i=1:n
       element=inputdlg('Enter Character');
       if(~isempty(element))
            FinalDataSet=[FinalDataSet;[element DataSet(i,:)]];
       end
   end
  </code></pre>
  
  <p>(The input dialog, as I observed returns <code>[]</code> if cancel is pressed)</p>
  
  <p>However, when I execute the above code
  <code>FinalDataSet</code> has the following form</p>
  
  <pre><code> 'H'    [1x400 double]
   'g'    [1x400 double]
   'i'    [1x400 double]
  </code></pre>
  
  <p>What is the problem here? Is it because I am trying to combine two different types of vectors? How can I obtain a (1000,401) dimension Matrix and not a (1000,2) Matrix?</p>
  
  <p>What I feel is that I either need to store the corresponding ASCII values for the characters or manage a separate vector for the User choice altogether. However, is it possible without the above two methods?? Please Help!!</p>