title: How can I add a string to the last line in multiline EditText, Matlab?
body: <p>I often use this way to add a string to the last line in multiline editText.</p>
  
  <p>Example: The before editText: (handles.txtLine)</p>
  
  <pre><code>line 1
  line 2
  line 3
  </code></pre>
  
  <p>and i want to add string "line 4" to it. So i do:</p>
  
  <pre><code>msg = get(handles.txtLine,'string');
  msg_i = sprintf('\nline 4');
  msg = [msg msg_i];
  set(handles.txtLine,'string',msg)
  </code></pre>
  
  <p>Result: </p>
  
  <pre><code>line 1
  line 2
  line 3
  line 4
  </code></pre>
  
  <p>Are there other methods to do the same function?</p>