Click or drag to resize
Accord.NET (logo)

MatrixMesh Method (Double, Double, Int32, Double, Double, Int32)

Creates a bi-dimensional mesh matrix.

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
public static double[][] Mesh(
	double rowMin,
	double rowMax,
	int rowSteps,
	double colMin,
	double colMax,
	int colSteps
)
Request Example View Source

Parameters

rowMin
Type: SystemDouble
rowMax
Type: SystemDouble
rowSteps
Type: SystemInt32
colMin
Type: SystemDouble
colMax
Type: SystemDouble
colSteps
Type: SystemInt32

Return Value

Type: Double
Examples
// The Mesh method can be used to generate all
// possible (x,y) pairs between two ranges. 

// We can create a grid as
double[][] grid = Matrix.Mesh
(
    rowMin: 0, rowMax: 1, rowSteps: 10,
    colMin: 0, colMax: 1, colSteps: 5
);

// Now we can plot the points on-screen
ScatterplotBox.Show("Grid (fixed steps)", grid).Hold();

The resulting image is shown below.

See Also