title: In MATLAB, can I have a script and a function definition in the same file?
body: <p>Suppose I have a function <code>f()</code> and I want to use it in <code>my_file.m</code>, which is a script.</p>
  
  <ol>
  <li>Is it possible to have the function defined in <code>my_file.m</code>?</li>
  <li>If not, suppose I have it defined in <code>f.m</code>. How do I call it in <code>my_file.m</code>?</li>
  </ol>
  
  <p>I read the online documentation, but it wasn't clear what is the best way to do this.</p>