Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

meshgrid

Generate a Mesh Grid


Description

Generate two matrices for use in three-dimensional plots.

Usage

meshgrid(x, y = x)

Arguments

x

numerical vector, represents points along the x-axis.

y

numerical vector, represents points along the y-axis.

Details

The rows of the output array X are copies of the vector x; columns of the output array Y are copies of the vector y.

Value

Returns two matrices as a list with X and Y components.

Note

The three-dimensional variant meshgrid(x, y, z) is not yet implemented.

See Also

Examples

meshgrid(1:5)$X
meshgrid(c(1, 2, 3), c(11, 12))

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.