I'm trying to call a MATLAB function from C# using MLApp
class, feval
function specifically.
Since I'm a beginner I looked through the internet and found help calling MATLAB functions. I just simply called a MATLAB function which takes two integers as input and MATLAB returns sum and difference correctly. But the reason I really need to do this is to send an image to MATLAB function and perform some analysis.
So far I haven't been able to find anything helpful over the internet. Can this class be used to pass images to MATLAB function if so, how? If not what other ways are there?
MATLAB
function [x,y] = myfunc(a,b)
x = a + b;
y = a-b;
C#
MLApp.MLApp matlab = new MLApp.MLApp();
matlab.Execute(@"cd 'D:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin'");
object result = null;
matlab.Feval("myfunc", 2, out result, 3, 2);
object[] res = result as object[];
Console.WriteLine(res[0]);
Console.WriteLine(res[1]);
Console.ReadLine();