<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239803</link>
    <title>MATLAB Central Newsreader - Matlab callbacks from Java</title>
    <description>Feed for thread: Matlab callbacks from Java</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 15 Feb 2009 07:15:09 -0500</pubDate>
      <title>Re: Matlab callbacks from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239803#628338</link>
      <author>Yair Altman</author>
      <description>&quot;Shawn Hershey&quot; &amp;lt;shliabnt@gmail.com&amp;gt; wrote in message &amp;lt;ggdepe$2hu$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I am currently developing a library for Matlab users at my company.  The functions in the library are such that I hope to write the code in Java or C++ rather than in M.  I have written Java code that is called by Matlab in the past and find it to be a nice interface, but this time I require my library functions make calls back to Matlab (ideally via function handles).  This seems to be possible using C or C++ Mex files, but I was hoping to code in Java, not C/C++.  Google searches haven't yielded any obvious solution.  Is it not actually possible to do something like the following:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 1) Make a Java call from matlab&lt;br&gt;
&amp;gt; 2) From the called Java function, make multiple Matlab calls (either using Matlab function handles, function names, or anything else).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If this is possible, great!  If not, I'm assuming I can do what I want using C/C++ MEX files.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance for your insight.&lt;br&gt;
&lt;br&gt;
What you require is JMI (Java-Matlab interface) - it's available but undocumented and discouraged by Matlab for reasons unknown. You can google JMI or search this forum for some references. Xtargets (&lt;a href=&quot;http://www.xtargets.com/snippets/tag/jmi)&quot;&gt;http://www.xtargets.com/snippets/tag/jmi)&lt;/a&gt; and JMatLink (&lt;a href=&quot;http://www.held-mueller.de/JMatLink/)&quot;&gt;http://www.held-mueller.de/JMatLink/)&lt;/a&gt; are also good starting points. You can also explore the jmi.jar package which is bundled with Matlab (in the ...\Java\jar\ folder).&lt;br&gt;
&lt;br&gt;
Yair Altman</description>
    </item>
    <item>
      <pubDate>Mon, 24 Nov 2008 05:41:02 -0500</pubDate>
      <title>Matlab callbacks from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239803#612796</link>
      <author>Shawn Hershey</author>
      <description>I am currently developing a library for Matlab users at my company.  The functions in the library are such that I hope to write the code in Java or C++ rather than in M.  I have written Java code that is called by Matlab in the past and find it to be a nice interface, but this time I require my library functions make calls back to Matlab (ideally via function handles).  This seems to be possible using C or C++ Mex files, but I was hoping to code in Java, not C/C++.  Google searches haven't yielded any obvious solution.  Is it not actually possible to do something like the following:&lt;br&gt;
&lt;br&gt;
1) Make a Java call from matlab&lt;br&gt;
2) From the called Java function, make multiple Matlab calls (either using Matlab function handles, function names, or anything else).&lt;br&gt;
&lt;br&gt;
If this is possible, great!  If not, I'm assuming I can do what I want using C/C++ MEX files.&lt;br&gt;
&lt;br&gt;
Thanks in advance for your insight.</description>
    </item>
  </channel>
</rss>

