且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用“在matlab中创建的dll";在C#中

更新时间:2022-11-08 20:28:31

似乎至少调用了DLL中的函数.但是当然,如​​果函数需要3个参数,则调用
It seems the function in the DLL is at least called. But of course if the function expects 3 Parameters the call
a.sumab(2,5);

会产生错误.通常在matlab中,如果要从函数返回值,可以将其称为

will produce an error. Usually in matlab if you want a return value from a function you call it

s = a.sumab(2, 5); 

,因为matlab没有参考参数.

我认为您应该重写您的Matlab函数,使其仅包含2个参数,并且当然会返回结果总和.

参见例如:
http://thinkmetric.com/tuts/matlab/functions.html [

since matlab doesnt have reference parameters.

I think you should rewrite your Matlab function so that it only excepts 2 parameters and of course returns the result sum.

See for example:
http://thinkmetric.com/tuts/matlab/functions.html[^]

But then again why even use Matlab for such a simple task...