Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Writing Matlab functions for Java classes
Date: Mon, 7 Jul 2008 10:45:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <g4ss3f$48g$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1215427503 4368 172.30.248.38 (7 Jul 2008 10:45:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 7 Jul 2008 10:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 542852
Xref: news.mathworks.com comp.soft-sys.matlab:477856



Hi, 

Suppose that I have a Java class, foo. Is there a way to
write a Matlab function that will be only invoked for
objects of type foo (or for its descendants)? For example, I
would like to write a function "sum" s.t. if x is of type foo,

sum(x) 

will invoke my function and not the built-in one. With
Matlab classes (pre-7.6), I can put the Matlab function to
the @foo directory. Is there something similar for Java
classes? 

Many thanks,
Stano