Fitlm function doesn't work when compiled on new computer

15 ビュー (過去 30 日間)
Sean Hannley
Sean Hannley 2015 年 11 月 4 日
コメント済み: Sean Hannley 2015 年 11 月 9 日
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 Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by