title: Adding an app when building an standalone application in MATLAB
body: <p>I am creating a stand-alone executable from a MATLAB app, using the MATLAB Compiler. When run the app has a button that calls a script M-file (myfile.m).</p>
  <p>MAIN FILE (trail.mlapp). Part of the .mlapp file.</p>
  <pre><code>function ButtonPushed(app,event)
       run myfile.m
       closereq
  end
  </code></pre>
  <p>This <code>myfile.m</code> also calls an another app in the middle (just another MATLAB app).  For this second app to execute properly (to avoid shadowing), it asked me to create a folder (let's say <code>X</code>) and put the app-related files in there.</p>
  <p>Now while creating the executable, I am not able to add the folder <code>X</code>. Is there anyway to do this?</p>
  <p>I looked up in some previous answers, they said:</p>
  <pre><code>if isdeployed
    fid = fopen(fullfile(ctfroot,'myfolder','myfile.dat'))
  end
  </code></pre>
  <p>But I don't know where to place this piece of code, whether in <code>myfile.m</code> or my main file for which I am creating the executable.</p>
  <p>I am calling the second app using this following commands:</p>
  <pre><code>APPINFO  = matlab.apputil.install('./X/Recomm')
  matlab.apputil.run('RecommAPP')
  </code></pre>