Borrar filtros
Borrar filtros

How do I instantiate a java interface from matlab?

3 visualizaciones (últimos 30 días)
Alexander
Alexander el 7 de Abr. de 2011
Editada: Andy Zelenak el 11 de Oct. de 2019
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 comentario
Richard Alcock
Richard Alcock el 3 de Mayo de 2011
Is you example missing something - it ends rather suddenly, and isn't currently valid Java.

Iniciar sesión para comentar.

Respuestas (2)

Paulo Silva
Paulo Silva el 7 de Abr. de 2011
  1 comentario
Alexander
Alexander el 7 de Abr. de 2011
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.

Iniciar sesión para comentar.


Andy Zelenak
Andy Zelenak el 11 de Oct. de 2019
Editada: Andy Zelenak el 11 de Oct. de 2019
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.

Categorías

Más información sobre Call Java from MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by