Matlab MWMCR::EvaluateFunction error in C# on one system
09:35 16 Apr 2021

I made a very simple program with C# VS2017 and Matlab 2012b:

namespace TestConMatlab
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var matlab = new MatlabFunction();
                double[] data = { 1, 2, 3 };
                double[,] r = (double[,])matlab.doMedian(data.ToArray());
                Console.Out.Write("OK: " + r.ToString());                
            } catch( Exception ex )
            {
                Console.Out.Write(ex.ToString());
            }
            Console.ReadLine();
        }
    }
}

This program run on mulitple PC, but on one computer I have :

System.Exception:

... MWMCR::EvaluateFunction error ...
Undefined function 'doMedian' for input arguments of type 'double'..


   at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction(String functionName, Int32 numArgsOut, Int32 numArgsIn, MWArray[] argsIn)
   at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction(String functionName, Object[] argsIn)
   at MatlabFunctionNative.MatlabFunction.doMedian(Object input)
   at TestConMatlab.Program.Main(String[] args) in C:\Users\User\source\repos\TestConMatlab\Program.cs:line 18

Of course I have installed the same Matlab MCR v8.0. I have trace some API call with procmon but I did not find solution.

c# matlab