I am using the Accord.Math Namespace for Visual Studio in c#.
I am trying to use the method MeshGrid<> under the Matrix class for the Accord.Math namespace. However, I am unsure how to implement this method even after reading the documentation for it seen here:
http://accord-framework.net/docs/html/M_Accord_Math_Matrix_MeshGrid__1.htm
Can anybody show me how to properly implement this method?
I have two Double[,] variables named xa and ya that I am trying to pass to MeshGrid. I have tried calling by using:
var q = Matrix.MeshGrid(xa,ya);
But for this is says that the type arguments cannot be inferred from their usage.
The output of MeshGrid is a 2-Tuple.
T1 is T[,]
T2 is T[,]
The Matrix.MeshGrid
method takes inputs as type of T[]
(not T[,]
).
Method signature:
public static Tuple<T[,], T[,]> MeshGrid<T>(this T[] sequence1, T[] sequence2);
Example:
var xi = new double[] {1, 2, 3, 4, 5};
var yi = new double[] {6, 7, 8, 9, 10};
Tuple<double[,], double[,]> grid = Matrix.MeshGrid(xi, yi);