文章标题
来源:互联网 发布:循迹小车c语言程序 编辑:程序博客网 时间:2024/05/21 04:21
c#(vs2013)、 matlab(2014a)混合编程
今天试着用c#和matlab混合编程,折腾了半天终于弄成功,记录一下。1、在Command Window窗口中输入mbuild –setup查看编译器,将编辑器设置为vs2、安装MCRinstaller.exe,在matlab安装目录下toolbox\compiler\deploy\win643、注册mwcomutil.dll,在\bin\win64中4、生成add.m文件
function [c]=add(a,b)c=a+b;end
5、在Command Window窗口中输入deploytool,生成dll
若成功:
若出现Matlab Compiler__Test checkout of feature ‘Compiler’ failed参考http://www.ilovematlab.cn/thread-315935-1-1.html
6、c#引用dll
class Program { static void Main(string[] args) { Class1 a = new Class1(); MWArray b = 3, c = 6; MWArray result = a.add(b, c); Console.WriteLine(result.ToString()); Console.ReadKey(); } }
引用生成的dll和toolbox\dotnetbuilder\bin\win64\v2.0下的MWArray.dll,再运行
若出现TypeInitializationException(类型初 始值设定项引发异常),参考http://www.cnblogs.com/machine/p/3829249.html
成功!
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 使用Intellij IDEA 创建maven 工程时缺少工程目录解决
- 关于开展阿里巴巴农村淘宝本地生活O2O商家招募活动的通知
- [leetcode 467]Unique Substrings in Wraparound String
- [USACO Nov07] 挤奶时间
- docker 搭建jenkins, 宿主机挂载路径uid,gid均正确却还报Permission denied,请考虑是否是selinux缘故
- 文章标题
- centos升级gcc版本遇到的一些问题
- curl 命令
- android打开系统相机分别获得原图和缩略图
- C语言——数组与指针
- 人权观察攻击“双规”,用心极其险恶
- Chain Of Responsibility
- JasperReport技术积累
- protobuf rpc介绍