call function from external class in Matlab S-function

1 回表示 (過去 30 日間)
Bhargav Jha
Bhargav Jha 2016 年 3 月 27 日
Hello, I want to use matlab function defined in a 3rd party class. Currently I am using interpreted matlab function to call the function from this class. But now I want to shift this code to m-file s-function.
So basically I want to create an instance of this class. The class has connect() function which needs to be called only once. And the class has getFrame() function which needs to be called every iteration. I want use this instance to be created once and then call the connect function only once. Later on I need to call getFrame() function every iteration using the same instance.
For this I have to create the object and set the connection on "function setup(block)", update data on "function Update(block)" and close the connection on "function Terminate(block)" but to do this I need to share the "instance" between these function.
Thanks in advance for your help!

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by