How do I instantiate a java interface from matlab?

I am trying to instantiate an interface of a java class. In java I would:
Class.IInterface newinterface = new
(I think)... But how can I do this within the matlab syntax?

1 件のコメント

Richard Alcock
Richard Alcock 2011 年 5 月 3 日
Is you example missing something - it ends rather suddenly, and isn't currently valid Java.

サインインしてコメントする。

回答 (2 件)

Paulo Silva
Paulo Silva 2011 年 4 月 7 日

0 投票

1 件のコメント

Alexander
Alexander 2011 年 4 月 7 日
Well of course I read the documentation, thanks though. Either it's not entirely clear or it's not there. I'm not asking how to use java with matlab; that, I am doing. I can't instantiate an interface within a given class in matlab, even though I have imported and can call the class constructor just fine.

サインインしてコメントする。

Andy Zelenak
Andy Zelenak 2019 年 10 月 11 日
編集済み: Andy Zelenak 2019 年 10 月 11 日

0 投票

I can confirm that it is possible to do this. I've used javaMethod(...) to call public static methods of a Java class which implements an interface. It didn't seem to take any unusual setup effort.

カテゴリ

ヘルプ センター および File ExchangeCall Java from MATLAB についてさらに検索

質問済み:

2011 年 4 月 7 日

編集済み:

2019 年 10 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by