Reputation: 1
i have a very big problem.
ich wrote a programm which is using a matlab dll. i build some classes with the matlab .net builder. it runs on my pc :)
the problem is, i want to use ist on a pc without matlab. so i installed mcr, but it dont run :(
what are the steps i should do? the system variable path is right... where i have to put the dll files? so many questions, please help me
Upvotes: 0
Views: 1453
Reputation: 1
Installed MCR (Note : if dll is 32 bit, then installed 32bit MCR if dll is 64 bit, then installed 64 bit MCR)
In C# code add following references:
a. MWarray
b. micrsoftcsharp
c. created dll
Add following in code:
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
using (dllname);
Declare class. For example:
Class1 test1 = null;
Create instance of class1
class. For example:
test1 = new Class1();
Call dll function / Invoke method. For example:
MWNumericArray c = test1.createFit4((MWNumericArray)x, (MWNumericArray)y).ToArray();
Upvotes: 0
Reputation: 1424
You can setup matlab runtime on the other PC.
It's pretty smaller than matlab.
Upvotes: 1
Reputation: 35088
Installing MCR on the target machine is the right first step. How did you build the .NET dll? Did you use DEPLOYTOOL or MCC? Note that the links I gave are for MATLAB Compiler. Make sure you use the documentation for the particular version of MATLAB Builder you use, in your case probably MATLAB Builder NE. If you do it right, the output of DEPLOYTOOL or MCC will be an executable that installs your DLL and its dependencies on the target machine. In MCC, look for the -B 'dotnet:'
option that tells the Builder to make a .NET dll.
Upvotes: 1
Reputation: 5001
The Matlab-"Compiler" can build an installable package that includes enough of Matlab for your App to run.
You could port the Matlab-Parts of your Code to Embedded Matlab and translate Matlab -> C with emlc
, which is included in some Toolboxes like the Realtime Workshop. The resulting C-code is usable completely without Matlab.
Upvotes: 1