title: Replacing \n in string with new lines in Matlab
body: <p>I'm trying to merge cell-array of strings delimiting each by new line to one string in Matlab.
  Following method merges the strings, but the final string contains \n instead of new lines:</p>
  
  <pre><code>function str = toString(self)
      % some not important logic that creates cell array called strings
      % ...
      str = '';
      for i = 1 : 9               
          str = strcat(str, strings(i), '\n');
      end  
  end
  </code></pre>
  
  <p>It returns: <code>'   111\n   111\n   111\n333666444555\n333666444555\n333666444555\n   222\n   222\n   222\n'</code></p>
  
  <p>When I add <code>str = sprintf(str);</code> before the end of the method, it returns Invalid format error. However when I write to Matlab command window <code>sprintf('   111\n   111\n   111\n333666444555\n333666444555\n333666444555\n   222\n   222\n   222\n');</code> it returns formatted string without any errors.</p>
  
  <p>Anyone knows what could be a problem? Why it works in command window but doesn't in .m file?</p>