Hello recently i am trying get the result using matlab function and matlab function can return double array like image but and then I got that double by object class in C# but I could not convert to double that object class some one could help me
I have solved this problem
MLApp.MLApp matlab = new MLApp.MLApp();
matlab.Execute(@"Path");
object result = null;
matlab.Feval("RemoveShadow", 1, out result, 12, 13);
var res = (result as object[]).Select(x => (double[,])x).ToArray();
object im = res.GetValue(0);
double[,] d = (double[,])im;
I have solved this problem
result.GetType()to see its exact type (in the debugger or doingConsole.WriteLine(result.GetType())if you are doing a console program)IndexOutOfRangeExceptionThat means that you are trying to access an index that does not exist in the array. I notice that you are callingres[1]. Are we sure that has a value? Arrays have a zero based index, which means the first element is at index 0 not index 1