title: Do a string split for more than one row in MATLAB
body: <p>I have written a for loop in which to split 5000 rows accordingly along each of the columns that they are in.</p>
  
  <p>Example of the cell array that contains those rows:
  <img src="https://i.stack.imgur.com/oT0Xq.jpg" alt="enter image description here"></p>
  
  <p>From that picture, i would like to split each row accordingly along their respective columns of that row starting from the first column to the end.</p>
  
  <p>This is the code that i have written:</p>
  
  <pre><code>for i = pdbindex(:,1)
  
      clean_pdb = regexprep(pdbindex, ':', ' '); % removes the colon (:) from the array and replaces it with a whitespace
      pdb2char = char(clean_pdb); % converts the cell array into a character array
      pdb2split = strsplit(pdb2char, ' '); % does a split based on the character array followed by a delimiter, which is the white space
  
  end
  </code></pre>
  
  <p>I have used Regular Expressions to replace the colons (:), with a whitespace. However, it is throwing me an error stating <code>Input strings must have one row.</code>. I don't know how to solve this.</p>
  
  <p>Please advise.</p>