<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375</link>
    <title>MATLAB Central Newsreader - Calling Matlab from Java</title>
    <description>Feed for thread: Calling Matlab 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>Wed, 09 Sep 2009 09:45:03 -0400</pubDate>
      <title>Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#678955</link>
      <author>Stephan Larws</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I'm trying to call Matlab functions from java via the Matlab Engine. It works fine as long as there are no Matlab GUI elements involved. But I need to call scripts which create a GUI and run then in their own Matlab window. Does anyone know if there are limitations to the type of scripts called via the matlab engine? Thanks for all your help :)</description>
    </item>
    <item>
      <pubDate>Wed, 09 Sep 2009 10:02:28 -0400</pubDate>
      <title>Re: Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#678958</link>
      <author>Rune Allnor</author>
      <description>On 9 Sep, 11:45, &quot;Stephan Larws&quot; &amp;lt;stephan.la...@iav.de&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'm trying to call Matlab functions from java via the Matlab Engine. It works fine as long as there are no Matlab GUI elements involved. But I need to call scripts which create a GUI and run then in their own Matlab window. Does anyone know if there are limitations to the type of scripts called via the matlab engine? Thanks for all your help :)&lt;br&gt;
&lt;br&gt;
Don't know if there are limitations, but there is at least&lt;br&gt;
ample opportunity for trouble if you start mixing a matlab&lt;br&gt;
GUI engine with an already existing GUI.&lt;br&gt;
&lt;br&gt;
Use java for the GUI and leave the matlab engine to deal&lt;br&gt;
with computations.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Thu, 10 Sep 2009 06:22:01 -0400</pubDate>
      <title>Re: Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#679205</link>
      <author>Stephan Larws</author>
      <description>Rune Allnor &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &amp;lt;25d774c7-0b3a-4822-88c4-82269abb04f6@x38g2000yqb.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; Don't know if there are limitations, but there is at least&lt;br&gt;
&amp;gt; ample opportunity for trouble if you start mixing a matlab&lt;br&gt;
&amp;gt; GUI engine with an already existing GUI.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Use java for the GUI and leave the matlab engine to deal&lt;br&gt;
&amp;gt; with computations.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Rune&lt;br&gt;
&lt;br&gt;
Hi Rune,&lt;br&gt;
&lt;br&gt;
thank you for your fast response. Normally I would do everything like you said, but my problem is, that these matlab scripts are already existing and they include the GUI and quite a bit of other code so rewriting everything would be my last resort. And unfortunately GUI code and program code are really tangled up :(. It seems that only calling GUIs that were made with GUIDE are problematic. It would be nice to know if anyone has a similar problem.</description>
    </item>
    <item>
      <pubDate>Thu, 10 Sep 2009 07:07:01 -0400</pubDate>
      <title>Re: Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#679213</link>
      <author>Stephan Larws</author>
      <description>&quot;Stephan Larws&quot; &amp;lt;stephan.larws@iav.de&amp;gt; wrote in message &amp;lt;h8a5u9$mcm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Rune Allnor &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &amp;lt;25d774c7-0b3a-4822-88c4-82269abb04f6@x38g2000yqb.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Don't know if there are limitations, but there is at least&lt;br&gt;
&amp;gt; &amp;gt; ample opportunity for trouble if you start mixing a matlab&lt;br&gt;
&amp;gt; &amp;gt; GUI engine with an already existing GUI.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Use java for the GUI and leave the matlab engine to deal&lt;br&gt;
&amp;gt; &amp;gt; with computations.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Rune&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hi Rune,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thank you for your fast response. Normally I would do everything like you said, but my problem is, that these matlab scripts are already existing and they include the GUI and quite a bit of other code so rewriting everything would be my last resort. And unfortunately GUI code and program code are really tangled up :(. It seems that only calling GUIs that were made with GUIDE are problematic. It would be nice to know if anyone has a similar problem.&lt;br&gt;
&lt;br&gt;
Don't know if anybody is interested, but I think I found a solution and it has nothing to do with the GUIs. Once I started the engine with engOpen() the pwd was the matlab root directory and that caused trouble. So changing the pwd made all my problems go away ;). </description>
    </item>
    <item>
      <pubDate>Thu, 10 Sep 2009 11:10:58 -0400</pubDate>
      <title>Re: Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#679266</link>
      <author>tristram.scott@ntlworld.com (Tristram Scott)</author>
      <description>Stephan Larws &amp;lt;stephan.larws@iav.de&amp;gt; wrote:&lt;br&gt;
&amp;gt; Rune Allnor &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &amp;lt;25d774c7-0b3a-4822-88c4-82269abb04f6@x38g2000yqb.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Don't know if there are limitations, but there is at least&lt;br&gt;
&amp;gt;&amp;gt; ample opportunity for trouble if you start mixing a matlab&lt;br&gt;
&amp;gt;&amp;gt; GUI engine with an already existing GUI.&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; Use java for the GUI and leave the matlab engine to deal&lt;br&gt;
&amp;gt;&amp;gt; with computations.&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; Rune&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hi Rune,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thank you for your fast response. Normally I would do everything like you&lt;br&gt;
&amp;gt; said, but my problem is, that these matlab scripts are already existing and&lt;br&gt;
&amp;gt; they include the GUI and quite a bit of other code so rewriting everything&lt;br&gt;
&amp;gt; would be my last resort. And unfortunately GUI code and program code are&lt;br&gt;
&amp;gt; really tangled up :(. It seems that only calling GUIs that were made with&lt;br&gt;
&amp;gt; GUIDE are problematic. It would be nice to know if anyone has a similar&lt;br&gt;
&amp;gt; problem.&lt;br&gt;
&lt;br&gt;
As you say, your problem is that the code for the GUI is tangled up with&lt;br&gt;
the code for the computations.  Even if you have already found a way around&lt;br&gt;
this, I would urge you to spend half an hour separating the gui code from&lt;br&gt;
the funcional code.  It makes life simpler for everyone.&lt;br&gt;
&lt;br&gt;
If you do choose to use Guide to create your GUIs, make a point of adding&lt;br&gt;
as few lines of code as possible to the automatically generated code that&lt;br&gt;
Guide produces.  Keep you own code away from what Guide produces, and that&lt;br&gt;
way you can keep Guide away from your code.  There have been many postings&lt;br&gt;
on this newsgroup relating sad stories of Guide not working well across&lt;br&gt;
different MATLAB releases.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Dr Tristram J. Scott               &lt;br&gt;
Energy Consultant                  </description>
    </item>
    <item>
      <pubDate>Thu, 10 Sep 2009 12:49:34 -0400</pubDate>
      <title>Re: Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#679296</link>
      <author>Rune Allnor</author>
      <description>On 10 Sep, 08:22, &quot;Stephan Larws&quot; &amp;lt;stephan.la...@iav.de&amp;gt; wrote:&lt;br&gt;
&amp;gt; Rune Allnor &amp;lt;all...@tele.ntnu.no&amp;gt; wrote in message &amp;lt;25d774c7-0b3a-4822-88c4-82269abb0...@x38g2000yqb.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Don't know if there are limitations, but there is at least&lt;br&gt;
&amp;gt; &amp;gt; ample opportunity for trouble if you start mixing a matlab&lt;br&gt;
&amp;gt; &amp;gt; GUI engine with an already existing GUI.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Use java for the GUI and leave the matlab engine to deal&lt;br&gt;
&amp;gt; &amp;gt; with computations.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Rune&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hi Rune,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; thank you for your fast response. Normally I would do everything like you said, but my problem is, that these matlab scripts are already existing and they include the GUI and quite a bit of other code so rewriting everything would be my last resort.&lt;br&gt;
&lt;br&gt;
Well, if your code is already a mess, it will not&lt;br&gt;
become less of a mess if you postpone straightening&lt;br&gt;
it out. There are only two valid reasons for you&lt;br&gt;
*not* reworking the code *now*:&lt;br&gt;
&lt;br&gt;
- The code will never  be used again.&lt;br&gt;
- Your last day on the project was today.&lt;br&gt;
&lt;br&gt;
If there is even the slightest chance somebody will&lt;br&gt;
use the code in the future, you are doing everybody&lt;br&gt;
a favour by clearing it up now.&lt;br&gt;
&lt;br&gt;
Syre, it will be a lot of work that is 'invisible'&lt;br&gt;
to your boss, but you (or whoever else will maintain&lt;br&gt;
the code in the future) will save immense amounts&lt;br&gt;
of both time and trouble.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Wed, 23 Sep 2009 09:58:03 -0400</pubDate>
      <title>Re: Calling Matlab from Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260375#682030</link>
      <author>Pontus H?rling</author>
      <description>Hello, I would like to call Matlab code not only matlab functions but code I have written myself) from a stand-alone Java program. You say you do it via the Matlab engine, but can this be done from Java? Is it not only from C/C++ or Fortran, so sys the manual...? Do you go in 2 steps via JNI (Java Native Interface) in C which has to be mex.ed or something?&lt;br&gt;
&lt;br&gt;
Best&lt;br&gt;
&lt;br&gt;
Pontus H?rling&lt;br&gt;
&lt;br&gt;
&quot;Stephan Larws&quot; &amp;lt;stephan.larws@iav.de&amp;gt; wrote in message &amp;lt;h87tev$18l$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm trying to call Matlab functions from java via the Matlab Engine. It works fine as long as there are no Matlab GUI elements involved. But I need to call scripts which create a GUI and run then in their own Matlab window. Does anyone know if there are limitations to the type of scripts called via the matlab engine? Thanks for all your help :)</description>
    </item>
  </channel>
</rss>

