# shiftdim

Shift array dimensions

## 📝 Syntaxe

* B = shiftdim(A, n)
* B = shiftdim(A)
* \[B, m] = shiftdim(A)

## 📥 Argument d'entrée

* A - Input array: vector, matrix or multidimensional array.
* n - Number of positions: integer value.

## 📤 Argument de sortie

* B - vector, matrix, or multidimensional array.
* m - Number of dimensions removed: non-negative integer.

## 📄 Description

shiftdim(A, n) reorganizes the dimensions of an array A by n positions.

Specifically, when n is a positive integer, it shifts the dimensions to the left, and when n is a negative integer, it shifts the dimensions to the right.

## 💡 Exemple

```matlab
A = rand(2, 3, 4);
size(A)
% Shift the dimensions of array A by 2 positions to the left
B = shiftdim(A, 2)
```

## 🔗 Voir aussi

[permute](https://nelson-9.gitbook.io/nelson/markdown/fr/elementary_functions/permute), [reshape](https://nelson-9.gitbook.io/nelson/markdown/fr/elementary_functions/reshape), [squeeze](https://nelson-9.gitbook.io/nelson/markdown/fr/elementary_functions/round).

## 🕔 Historique

| Version | 📄 Description   |
| ------- | ---------------- |
| 1.3.0   | version initiale |
