Fitlm function doesn't work when compiled on new computer

8 次查看(过去 30 天)
My function works in Matlab and when compiled on one computer, but not a new one that I just set up with the exact same installed files, dependencies and references. This is the error it give me when I try to run the function in VS 2013, again this all works just fine on another computer with the exact same files installed:
An unhandled exception of type 'System.Exception' occurred in MWArray.dll
Additional information:
... MWMCR::EvaluateFunction error ...
Undefined variable "internal" or class "internal.stats.parseArgs".
Error in => RegressionTrainR2.m at line 5.
... Matlab M-code Stack Trace ...
at
file C:\Users\instadat\AppData\Local\Temp\2\instadat\mcrCache8.3\MathFu1\toolbox\stats\classreg\@LinearModel\LinearModel.m, name LinearModel.fit, line 849.
at
file C:\Users\instadat\AppData\Local\Temp\2\instadat\mcrCache8.3\MathFu1\toolbox\stats\classreg\fitlm.m, name fitlm, line 117.
at
file C:\Users\instadat\AppData\Local\Temp\2\instadat\mcrCache8.3\MathFu1\MathFunction\RegressionTrainR2.m, name RegressionTrainR2, line 5.
  1 个评论
Sean Hannley
Sean Hannley 2015-11-9
Resolved. Had to uninstall every bit of mathworks software from system, delete any file or folder with the word matlab in it and reinstall just the dll library.

请先登录,再进行评论。

回答(1 个)

Tushar Sinha
Tushar Sinha 2015-11-6
Hi Sean,
Which MATLAB version did you compile your code with? It could be possible that the version and bitness of MCR is not matching with the version of Matlab Compiler used to create the application.
Another reason could be that the .NET dll is compiled with 64-bit MATLAB and in order to call the 64-bit .NET assembly DLL properly, the C# application in Visual Studio needs to be compiled in 64-bit as well. It is possible that in your Visual Studio project, you haven't changed the Solution Platform from "Any CPU" to "x64".
This article on StackOverflow contains detailed steps on how to change the solution platform to x64:
Thanks,
Tushar
  1 个评论
Sean Hannley
Sean Hannley 2015-11-9
I've had that problem before and this time it was different. I've resolved the situation. Comment on how above.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by