How can I use Matlab objects in compiled .NET assemblies?

懵懂的女人 提交于 2019-12-04 09:29:27

It is not possible to use Matlab classes inside .NET assemblies. There are numerous workarounds:

  1. Define your variable as global , and access it with several functions that wrap its methods
  2. Return your Matlab class as a value of field in struct.

Here is a code snippet for (1):

function CreateMyClass(st)
    global myClass;
    myClass = MyClass(st);
end

function DisplayMyClass()
    global myClass;
    myClass.display();
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!