title: Converting MATLAB files to Octave
body: <p>I have a series of experiments that were written for MATLAB, but recently we are trying to run them through Octave instead. I realize they are mostly compatible, but I have been running into a few problems, and none of the online FAQs or directions I have found have addressed these at all. It's complicated a bit because there are multiple .m files that interact; however, for now I am going to focus on the main program. Anyway, so when I try to run the file (MLP.m) through octave, I get the following errors in the Terminal window:</p>
  
  <pre><code>error: dir: expecting directory or filename to be a char array
  error: called from:
  error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/miscellaneous/dir.m at line 128, column 5
  error: /Applications/MATLAB_R2008a/toolbox/psychoacoustics/MLParameters.m at line 86, column 7
  error: /Applications/MATLAB_R2008a/toolbox/psychoacoustics/MLP.m at line 9, column 3
  </code></pre>
  
  <p>The lines it is referencing are as follows:</p>
  
  <p>1)</p>
  
  <pre><code>d = dir([cd myslash 'Experiments_MLP'  myslash '*.m']);
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>s = MLParameters; 
  </code></pre>
  
  <p>What about these lines is incompatible with Octave? I can't find anything online that indicates that these won't work.</p>
  
  <p>After that, the Terminal window gives me this batch of nonsense:</p>
  
  <pre><code>dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
    Referenced from: /usr/X11R6/lib/libfontconfig.1.dylib
    Reason: Incompatible library version: libfontconfig.1.dylib requires version 13.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
  dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
    Referenced from: /usr/X11R6/lib/libfontconfig.1.dylib
    Reason: Incompatible library version: libfontconfig.1.dylib requires version 13.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
  /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 71:  1077 Trace/BPT trap          GNUTERM="${GNUTERM}" GNUPLOT_HOME="${GNUPLOT_HOME}" PATH="${PATH}"     DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" HOME="${HOME}" GNUHELP="${GNUHELP}" DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" DISPLAY="${DISPLAY}" GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" "${ROOT}/bin/gnuplot-4.2.6" "$@"
  /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 71:  1083 Trace/BPT trap          GNUTERM="${GNUTERM}" GNUPLOT_HOME="${GNUPLOT_HOME}" PATH="${PATH}" DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" HOME="${HOME}" GNUHELP="${GNUHELP}" DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" DISPLAY="${DISPLAY}" GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" "${ROOT}/bin/gnuplot-4.2.6" "$@"
  error: you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function
  </code></pre>
  
  <p>I have GNUPlot installed, and I checked the gnuplot_binary function, which didn't give me any answers. GNUPlot is installed in my /Applications directory, along with Octave itself. Why shouldn't this work? The README file that came with GNUPlot didn't indicate a special directory for it to be installed in. What about the the dyld library not loaded errors? Is that related to the GNUPlot problem, or is it something else?</p>
  
  <p>Anyway, thanks for your help</p>