Is there an error in the documentation for External Interfaces in MATLAB 7.0 (R14) with how MATLAB handles undefined methods?
2 次查看(过去 30 天)
显示 更早的评论
I have a created a file foo.m on my MATLAB path. The contents of the file are below.
function foo(a)
disp(a)
When I execute the following command
ja=java.lang.String('aaa');
ja.foo
I receive the following result
a =
aaa
The documentation states that MATLAB looks for built-in functions when a MATLAB command invokes a nonexistent method on a Java object.
采纳的回答
MathWorks Support Team
2009-6-27
This change has been incorporated into the documentation in Release 14 Service Pack 3 (R14SP3). For previous releases, read below for any additional information:
This is an error within the documentation for MATLAB within the External Interfaces section. The documentation should read as follows:
If your MATLAB command invokes a nonexistent method on a Java object, MATLAB looks for a function with the same name. If MATLAB finds a function of that name, it attempts to invoke it. If MATLAB does not find a function with that name, it displays a message stating that it cannot find a method by that name for the class.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Java from MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!