在c#中调用matlab函数 [英] call matlab function in c#

查看:793
本文介绍了在c#中调用matlab函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨每一个

我试图在c#项目中调用matlab函数

我按照

中的步骤 http://xinyustudio.wordpress.com/ 2009/11/12 / using-matlab-functions-in-c-2009b / [ ^ ]

http://scriptbucket.wordpress.com / 2012/07/18 /如何调用函数在matlab中生成的net-dll-from-c / [ ^ ]



但是当我运行c#项目时我得到了这个错误和警告

无法加载文件或程序集'MWArray,版本= 2.12。 1.0,Cul ture = neutral,PublicKeyToken = e1d84a0da19db86f'或其依赖项之一。试图加载一个格式不正确的程序





hi every one
I am trying to call matlab function in c# project
I followed steps in
http://xinyustudio.wordpress.com/2009/11/12/using-matlab-functions-in-c-2009b/[^]
http://scriptbucket.wordpress.com/2012/07/18/how-to-call-functions-in-a-matlab-generated-net-dll-from-c/[^]

but when I ran c# project I got this Error and warning
"Could not load file or assembly 'MWArray, Version=2.12.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' or one of its dependencies. An attempt was made to load a program with an incorrect format"


"

Warning 2   There was a mismatch between the processor architecture of the project being built "x86" and the processor architecture of the reference "MWArray, Version=2.12.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.   test_zip









我的窗户是Windows 7 64位

我正在使用visual studio 2010

和matlab 2012b 64位





注意:

我在同一台电脑上完成了所有步骤



感谢所有


"


my windows is windows 7 64 bit
and I am using visual studio 2010
and matlab 2012b 64 bit


note :
I did all steps on the same computer

Thanks to all

推荐答案

我认为你应该在x64中构建,因为你的项目是x86而你的参考x64



I think you should build both in x64 because your project is x86 and your reference x64

引用:

请考虑通过配置管理器更改项目的目标处理器体系结构,以便在项目和引用之间对齐处理器体系结构

Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references


这篇关于在c#中调用matlab函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆