title: How to insert strings in array while looping in MATLAB?
body: <p>How can I insert strings in an array while looping in MATLAB? I know it's very simple but I get a mismatch error. Here is sample code.</p>
  
  <pre><code>s={'asd', 'xyzs', 'pqrs','mnopr'};    
  for i=1:4
      w=randint(1,1,[1,2]);
  
      switch w   
        case 1 
          word(i)=s(i);
  
        otherwise  
          word(i)=3;   
      end   
  end
  </code></pre>