Sorry if this question has already been asked, but I could not find what I was looking for. I was wondering if there is a way to work with the compiled c-shared MATLAB library in C # without using MCR / MATLAB (or any additional installation at all), for example. to use this simple test.m function, compile it through mcc into a .dll, and then use it in C #:
[x,y,z]=test(a,b,c)
%x,a are integers
%y,z,b are matrices
%c is a string (which e.g. could be used to switch between several modes)
x=a*a;
y=b*b-b;
z=y*y;
I'm not quite sure that this is possible (not to mention it is easy), but even with this simple example, I cannot get it to work in C #, although this may also be relevant to my very limited C # experience. I believe that in this example I would have to use IntPtr to process matrices, for example:
[DllImport("test.dll",EntryPoint="mlfTest")]
public static extern void testfunction([In] numargout, ref IntPtr x, ref IntPtr y, ref IntPtr z, [In] IntPtr a, [In] ref double[,] b, [In] ref c)
x, y, z, ? , , . , ref double [,] dll , .
, , MCR ( ), .
.