您的位置:首页 > 编程语言 > MATLAB

Matlab 调用 C# dll

2015-10-28 09:21 211 查看
1.VS 建立一个类库工程

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Matleb1

{

    public class Class1

    {

        public static int method1()

        {

            return 15;

        }

    }

}

shift+F6编译

2.打开matlab R2014  输入以下两行

>> NET.addAssembly('d:\vsProject\Matleb1\Matleb1\bin\Debug\Matleb1.dll')

>> Matleb1.Class1.method1()

结果:

ans =

          15
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  matlab .net