<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.1</li>
<li>Operating System / Platform =&gt; macOS 10.12</li>
<li>Compiler =&gt; gcc</li>
<li>Matlab =&gt; Matlab_R2016b</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Cannot find Matlab automatically, because <code class="notranslate">OpenCVFindMatlab.cmake</code> looks for a wrong name.</p>
<h5 dir="auto">Solution</h5>
<p dir="auto">Change in <code class="notranslate">OpenCVFindMatlab.cmake</code> at line 65</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)"><pre class="notranslate"><code class="notranslate">file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)
</code></pre></div>
<p dir="auto">to</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (APPLE)
  file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB_R*)
else()
  file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)
endif()"><pre class="notranslate"><code class="notranslate">if (APPLE)
  file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB_R*)
else()
  file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)
endif()
</code></pre></div>
<p dir="auto">DONE.</p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.1</li>
<li>Operating System / Platform =&gt; OS X El Capitan 10.11.3</li>
<li>Compiler =&gt; Xcode 7.3.1 - Apple LLVM version 7.3.0 (clang-703.0.31)</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">This line in OpenCVFindMatlab.cmake does not find an existing Matlab installation:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)"><pre class="notranslate"><code class="notranslate">file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)
</code></pre></div>
<p dir="auto">However, changing it to the following finds the installation correctly:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB_R*)"><pre class="notranslate"><code class="notranslate">file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB_R*)
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>