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

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

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 Exchange에서 Call 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