Click here to Skip to main content
14,298,783 members

Calling MATLAB function in c#

Sa na asked:

Open original thread
Hi all!
I am trying to call matlab function in my c# windows form application. I followed all the steps which are given by matthworks for deploying a project. I included
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;


also a reference to the DLL of that function i.e.
using wavrec;;


But when I compile the project it gives the following error
C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:"C:\Program Files (x86)\MATLAB\R2006b\bin\win32\MWArray.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:..\..\..\..\MATLAB\NNtrain\wavrec\distrib\wavrec.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\Interface_project.exe /resource:obj\Release\Interface_project.Main.resources /resource:obj\Release\Interface_project.Properties.Resources.resources /resource:obj\Release\Interface_project.TestForm.resources /resource:obj\Release\Interface_project.TrainForm.resources /resource:obj\Release\Interface_project.Training_Patterns.resources /target:winexe Main.cs Main.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs QuranDataSet.Designer.cs Test.cs Test.Designer.cs Train.cs Train.Designer.cs Training_Patterns.cs Training_Patterns.Designer.cs

c:\Users\Abro\Documents\MATLAB\NNtrain\wavrec\distrib\wavrec.dll: error CS1705: Assembly 'wavrec, Version=0.0.4349.23403, Culture=neutral, PublicKeyToken=null' uses 'MWArray, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' which has a higher version than referenced assembly 'MWArray, Version=1.0.2415.7148, Culture=neutral, PublicKeyToken=e1d84a0da19db86f'



I am using windows 7, system 64-bit, MATLAB 7.6.0, visual studio 2008

Can any one tell me what can be the problem and how to solve please?
Thanks in advance.
Tags: C#, Matlab

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100