Click or drag to resize
Accord.NET (logo)

MatrixMesh Method (DoubleRange, Int32, DoubleRange, 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(
	DoubleRange rowRange,
	int rowSteps,
	DoubleRange colRange,
	int colSteps
)
Request Example View Source

Parameters

rowRange
Type: AccordDoubleRange
rowSteps
Type: SystemInt32
colRange
Type: AccordDoubleRange
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