Error MWMCR::EvaluateFunction error on specific system on compiled C#

I created a 32bit C# simple application with VS2017:
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 work on many win10 with MRC v8.0 installed, but on one system 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 x86. I have trace some API call with procmon but I did not find solution.

回答(1 个)

I have deleted the folder C:\Users\%USER%\AppData\Local\Temp\%USER%\mcrCache8.0. Remove MCR and delete manualy C:\Program Files (x86)\MATLAB, and after restart, program work !

类别

帮助中心File Exchange 中查找有关 Deploy to .NET Applications Using MWArray API 的更多信息

产品

版本

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by