title: How to define empty character array in matlab?
body: <pre><code>for i=1:POPULATION_SIZE
      for j=1:NO_PARAMETERS
          c=dec2bin(parameters(j),NO_BITS_PARAMETER);
          chromosomes(i) = [chromosomes(i) c];
      end
  end
  </code></pre>
  
  <p>above code is giving the following error:</p>
  
  <blockquote>
    <p>??? Undefined function or method 'chromosomes' for input arguments of type 'double'.</p>
  </blockquote>
  
  <p>I need an empty array of characters named <code>chromosomes</code>.
  I tried adding following line before the above loops.</p>
  
  <pre><code>chromosomes(1:POPULATION_SIZE)='';
  </code></pre>
  
  <p>but its not working. It gives error </p>
  
  <p><code>???  Index of element to remove exceeds matrix dimensions.</code></p>