title: Matlab function handles and C++ function pointers
body: <p>Is it possible to make a Matlab function handle compatible with a C++ function pointer? I am trying to call a C++ function from Matlab that takes in a C++ function pointer. For example:</p>
  
  <blockquote>
    <p>C++:</p>
  </blockquote>
  
  <pre><code>void Cfunction( C++functionPointer);
  </code></pre>
  
  <blockquote>
    <p>Matlab:</p>
  </blockquote>
  
  <pre><code>function out Mfunction(functionHandle)
       out= Cfunction(functionHandle)
  </code></pre>
  
  <p>Unfortunately I can not post the code because it is confidential. So I want my Matlab program to call a C++ function using calllib(). One of the parameters for the C++ function is a function pointer. In Matlab, I tried using a Matlab function handle as the parameter in callib but this did not work. Therefore, I am having difficulty calling the C++ function from Matlab.</p>
  
  <p><strong>Matlab is saying that the C++ compiler will not accept the Matlab function handle type for its pointer argument.</strong> </p>
  
  <p>Thanks</p>