# shuffle {#shuffle}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`shuffle(X)`

## Arguments {#arguments}

**X** is a vector/matrix.

## Details {#details}

Return a new vector/matrix after taking a shuffle on the data.

## Examples {#examples}

```
x=(1..6).shuffle();
x;
// output: [1,6,3,5,4,2]

x.shuffle!();
// output: [5,4,1,3,2,6]


x=(1..6).reshape(3:2);
x;
```

|\#0|\#1|
|---|---|
|1|4|
|2|5|
|3|6|

```
x.shuffle();
```

|\#0|\#1|
|---|---|
|5|3|
|2|1|
|4|6|

