如何在C#中将MATLAB函数用作.dll? [英] How to use a MATLAB function as a .dll in C#?

查看:113
本文介绍了如何在C#中将MATLAB函数用作.dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从MATLAB函数(.m文件)中创建了一个.dll.
该函数如下所示:
[a(double)] = fname(b(整数数组),c(双精度数组),d(双精度))
现在,我想用C#调用它.我该怎么办?
首先,我在项目中添加了.dll作为参考.
然后通过应用"using"关键字来尝试调用它.
但是我不知道下一步.如何将"b","c","d"传递给MATLAB
然后得到结果"a"?
感谢任何评论.

I have made a .dll from a MATLAB function (.m file).
The function looks like this:
[a (double)] = fname(b (integer array), c (double array), d (double))
Now, I want to call it in C#. What should I do?
First, I added the .dll as reference in the project.
and then by applying "using" keyword I''ve tried to call it.
But I do not know the next step. How should I pass "b","c","d" to MATLAB
and then get the result, "a"?
Any comment is appreciated.

推荐答案

这确实是一个问题,即MATLAB dll如何公开其方法签名,以便C#程序可以调用它.我建议您查看MATLAB文档以获取指导.
It''s really a question of how a MATLAB dll exposes its method signature such that a C# program can call it. I would suggest looking at the MATLAB documentation for guidance.


这篇关于如何在C#中将MATLAB函数用作.dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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