title: Running Matlab .m file with arguments in a bash script
body: <p>I have a Matlab .m file that takes three input arguments:</p>
  <blockquote>
  <p>calculate('input.txt','Alex','output.txt')</p>
  </blockquote>
  <p>I would like to run this .m file in a shell script as follows:</p>
  <blockquote>
  <p>matlab -nodisplay -nodesktop -r &quot;run
  calculate('input.txt','Alex','output.txt)&quot;</p>
  </blockquote>
  <p>Unfortunately, this did not work. I get the following error:</p>
  <blockquote>
  <p>Error using run (line 70)</p>
  <p>calculate('input.txt','Alex','output.txt') not
  found.</p>
  </blockquote>
  <p>Any pointer as to how I can give the input arguments/variables?</p>
  <p>Thanks.</p>
  <p>Note: The following did not work either - complaining too many arguments.</p>
  <blockquote>
  <p>matlab -nodisplay -nodesktop -r &quot;run calculate input.txt Alex output.txt&quot;</p>
  </blockquote>