title: Edit multiple Matlab .m files using Matlab
body: <p>I have some 50+ m files that worked in a previous driver version but are outdated for the newer driver version. As a result, I need to find and replace various variable or field names, and sometimes edit variable inputs for all these files.
  For example, I'd like to find the line </p>
  
  <pre><code>src.aaaa = 100;
  </code></pre>
  
  <p>and replace it to:</p>
  
  <pre><code>src.bbbb = 100;
  </code></pre>
  
  <p>another example is to replace:</p>
  
  <pre><code>vid = videoinput('xxxx' ,1, 'yyy')
  </code></pre>
  
  <p>with:</p>
  
  <pre><code>vid = videoinput('kkkkkk' ,1, 'zzzz')
  </code></pre>
  
  <p>I've searched and found <a href="https://stackoverflow.com/questions/12595662/search-for-text-across-multiple-m-files-within-the-matlab-user-interface">this discussion</a>, that allows to search in multiple files, but not really edit or replace anything. I can handle matlab so I'm looking for a way to do that in matlab. Any ideas?</p>