C# with matlab via COM
不知道为什么,I run official’s example,却提示我以下信息。若是使用Execute直接执行.m代码是可以的,不知道为什么执行.m写的的function就不可以,在C#中我也引用了MLAPP
未定义与’double’类型的输入参数相对应的函数myfunc
but I indeed write myfunc function in E:modelfirst
.m code:
function [x,y] = myfunc(a,b,c)
x = a + b;
y = sprintf(‘Hello %s’,c);
C# code :
MLApp.MLApp matlab = new MLApp.MLApp();
matlab.Execute(@"cd E:modelfirstmyfunc");
object result = null;
matlab.Feval("myfunc", 2, out result, 3.14, 42.0, "world");
object[] res = result as object[];
Console.WriteLine(res[0]);
Console.WriteLine(res[1]);
Console.ReadLine();
find help
thank you!!!不知道为什么,I run official’s example,却提示我以下信息。若是使用Execute直接执行.m代码是可以的,不知道为什么执行.m写的的function就不可以,在C#中我也引用了MLAPP
未定义与’double’类型的输入参数相对应的函数myfunc
but I indeed write myfunc function in E:modelfirst
.m code:
function [x,y] = myfunc(a,b,c)
x = a + b;
y = sprintf(‘Hello %s’,c);
C# code :
MLApp.MLApp matlab = new MLApp.MLApp();
matlab.Execute(@"cd E:modelfirstmyfunc");
object result = null;
matlab.Feval("myfunc", 2, out result, 3.14, 42.0, "world");
object[] res = result as object[];
Console.WriteLine(res[0]);
Console.WriteLine(res[1]);
Console.ReadLine();
find help
thank you!!! 不知道为什么,I run official’s example,却提示我以下信息。若是使用Execute直接执行.m代码是可以的,不知道为什么执行.m写的的function就不可以,在C#中我也引用了MLAPP
未定义与’double’类型的输入参数相对应的函数myfunc
but I indeed write myfunc function in E:modelfirst
.m code:
function [x,y] = myfunc(a,b,c)
x = a + b;
y = sprintf(‘Hello %s’,c);
C# code :
MLApp.MLApp matlab = new MLApp.MLApp();
matlab.Execute(@"cd E:modelfirstmyfunc");
object result = null;
matlab.Feval("myfunc", 2, out result, 3.14, 42.0, "world");
object[] res = result as object[];
Console.WriteLine(res[0]);
Console.WriteLine(res[1]);
Console.ReadLine();
find help
thank you!!! c#, com MATLAB Answers — New Questions