title: What is the closest way to pass string arguments from bash script to matlab file?
body: <p>I have matlab file matlab_param.m</p>
  
  <pre><code>function matlab_param(param1, param2)
  
  disp(sprintf('param1 : %s', param1));
  disp(sprintf('param2 : %s', param2));
  </code></pre>
  
  <p>And I want to have bash script bash_param.sh that look like</p>
  
  <pre><code>#!/bin/bash
  echo $1
  echo $2
  ./matlab_param.m $1 $2
  </code></pre>
  
  <p>I want to run this bashscirpt</p>
  
  <pre><code>./bash_param.sh hello world
  </code></pre>
  
  <p>and it will print</p>
  
  <pre><code>hello
  world
  param1 : hello
  param2 : world
  </code></pre>
  
  <p>I googled for hours and couldn't find any exact solution for this. The closest one the I got so far is</p>
  
  <pre><code>matlab -nodesktop -nosplash -nodisplay -r "try, run ('./test_param.m'); end; quit"
  </code></pre>
  
  <p>which I need to hardcode all parameters.</p>