Clear Filters
Clear Filters

Fitlm function doesn't work when compiled on new computer

8 views (last 30 days)
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 Comment
Sean Hannley
Sean Hannley on 9 Nov 2015
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.

Sign in to comment.

Answers (1)

Tushar Sinha
Tushar Sinha on 6 Nov 2015
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 Comment
Sean Hannley
Sean Hannley on 9 Nov 2015
I've had that problem before and this time it was different. I've resolved the situation. Comment on how above.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!