<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172126</link>
    <title>MATLAB Central Newsreader - Writing Matlab functions for Java classes</title>
    <description>Feed for thread: Writing Matlab functions for Java classes</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>Mon, 07 Jul 2008 10:45:03 -0400</pubDate>
      <title>Writing Matlab functions for Java classes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172126#441502</link>
      <author>Stanislav Funiak</author>
      <description>Hi, &lt;br&gt;
&lt;br&gt;
Suppose that I have a Java class, foo. Is there a way to&lt;br&gt;
write a Matlab function that will be only invoked for&lt;br&gt;
objects of type foo (or for its descendants)? For example, I&lt;br&gt;
would like to write a function &quot;sum&quot; s.t. if x is of type foo,&lt;br&gt;
&lt;br&gt;
sum(x) &lt;br&gt;
&lt;br&gt;
will invoke my function and not the built-in one. With&lt;br&gt;
Matlab classes (pre-7.6), I can put the Matlab function to&lt;br&gt;
the @foo directory. Is there something similar for Java&lt;br&gt;
classes? &lt;br&gt;
&lt;br&gt;
Many thanks,&lt;br&gt;
Stano</description>
    </item>
    <item>
      <pubDate>Thu, 30 Oct 2008 18:31:49 -0400</pubDate>
      <title>Re: Writing Matlab functions for Java classes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172126#608140</link>
      <author>Matt </author>
      <description>You could write a sum method for your java class. As long as the return type for the method was something that Matlab is happy with (double, int, boolean, a instance of the foo class, etc) then you can call the method with &lt;br&gt;
&amp;gt;&amp;gt; out = sum(foo); &lt;br&gt;
or the more traditional&lt;br&gt;
&amp;gt;&amp;gt; out = foo.sum;</description>
    </item>
  </channel>
</rss>

