title: Setting the output directory of mex files in the compiler command
body: <p>My Project has the following structure:</p>
  
  <pre><code>MainFolder:
    &gt;&gt;InitToolbox.m     //Here addpaths are executed
    &gt;&gt;Compile.m         //Here mex compilations calls are made
      AlgorithmsFolder  //MATLAB code
      UtilitiesFolder   //MATLAB code
      MexFolder         // C++ files
         &gt;&gt;test1.cpp
         &gt;&gt;test2.cu
  </code></pre>
  
  <p>Whever I run (either in <code>compile.m</code> or directly in the command line) the following compiler call:</p>
  
  <pre><code>mex -v -largeArrayDims ./MexFolder/test1.cpp ./MexFolder/test2.cu
  </code></pre>
  
  <p>The output <code>test1.mexw64</code> is saved in <code>MainFolder</code>.</p>
  
  <p><strong>Is there any way to modify the compiler call to create the <code>.mexw64</code> file either on the original location of the files or in an specific user defined location?</strong></p>