Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.

meshgrid

Florian Rappl edited this page Dec 21, 2014 · 2 revisions

meshgrid

Generate X and Y matrices for three-dimensional plots.

meshgrid(x)

The function call is the same as [X, Y] = meshgrid(x, x), i.e. the input value is seen as both, X and Y vector.

Argument x

Matrix

Returns 1. entry

Matrix : The generated X value matrix.

Returns 2. entry

Matrix : The generated Y value matrix.

meshgrid(x,y)

Transforms the domain specified by vectors x and y into arrays X and Y, which can be used to evaluate functions of two variables and three-dimensional mesh/surface plots. 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.

Argument x

Matrix

Argument y

Matrix

Returns 1. entry

Matrix : The generated X value matrix.

Returns 2. entry

Matrix : The generated Y value matrix.

Example

meshgrid(1:3, 10:14)

Creates the X and Y matrices with X having the values 1 to 3 in each row, while Y has the values 10 to 14 in each column.

Clone this wiki locally