# ndgrid

Rectangular grid in N-D space

## 📝 Syntaxe

* \[X1, X2, ..., Xn] = ndgrid(x1, x2, ... , xn)
* \[X1, X2, ..., Xn] = ndgrid(xg)

## 📥 Argument d'entrée

* x1, x2, … , xn - vector: grid vectors as separate arguments.
* xg - vector: grid vector for all dimensions.

## 📤 Argument de sortie

* X1, X2, … , Xn - array: full grid representation.

## 📄 Description

\[X1, X2, … , Xn] = ndgrid(x1, x2, … , xn) generates an n-dimensional full grid by replicating each grid vector.

\[X1, X2, … , Xn] = ndgrid(xg) In this scenario, the single grid vectorxg is used for all dimensions. The number of output arguments determines the dimensionality n of the resulting grid.

## 💡 Exemples

```matlab
M = {'apple', 'banana', 'cherry'};
N = {'blue', 'green', 'red'};
ndgrid(M , N)

```

```matlab
[X, Y] = ndgrid(1:2:19, 2:2:12)
```

## 🔗 Voir aussi

[meshgrid](https://nelson-9.gitbook.io/Nelson/markdown/fr/elementary_functions/meshgrid), [mesh](https://nelson-9.gitbook.io/Nelson/markdown/fr/graphics/mesh).

## 🕔 Historique

| Version | 📄 Description   |
| ------- | ---------------- |
| 1.6.0   | version initiale |
