Calling Matlab class function from C

315 views Asked by At

I have the following Matlab code in myMatlabClass.m:

classdef myMatlabClass < handle
properties
  value
end

methods
   function obj = myMatlabClass()
      obj.value = 0;
   end

   function value = getValue(obj)
      value = obj.value;
   end

   function setValue(obj, newValue)
      obj.valu = newValue;
   end
end

I'm trying to call these functions from C after compiling this code using Matlab compiler (mcc). The issue is, mcc will only create a C function for the file, not for the member functions:

bool MW_CALL_CONV mlxmyMatlabClass(int nlhs, mxArray *plhs[], int nrhs, mxArray 
                                     *prhs[]);

and an equivalent vararg-version.

I suppose, this function will create an object (haven't tried yet). -

Is it possible to call the object's member functions from C?

0

There are 0 answers