# squeeze() Function & Examples

Use the squeeze() matrix function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## squeeze

#### squeeze(x)

Try it yourself:

```calculio
a = zeros(3,2,1)
size(squeeze(a))
b = zeros(1,1,3)
size(squeeze(b))
```

[concat](https://calcul.io/function/concat/index.md)

[det](https://calcul.io/function/det/index.md)

[diag](https://calcul.io/function/diag/index.md)

[identity](https://calcul.io/function/identity/index.md)

[inv](https://calcul.io/function/inv/index.md)

[ones](https://calcul.io/function/ones/index.md)

[range](https://calcul.io/function/range/index.md)

[size](https://calcul.io/function/size/index.md)

[subset](https://calcul.io/function/subset/index.md)

[trace](https://calcul.io/function/trace/index.md)

[transpose](https://calcul.io/function/transpose/index.md)

[zeros](https://calcul.io/function/zeros/index.md)

---

## squeeze(): Removing Singleton Dimensions

**squeeze()** removes dimensions of length one from an array or matrix. It makes data easier to work with after slicing or importing a shape such as 1×n×1.

## Shape changes

squeeze changes dimensions but not the stored values. Inspect before and after with [size()](https://calcul.io/function/size/index.md). Use [reshape()](https://calcul.io/function/reshape/index.md) when you need a specific target shape rather than automatic removal.

Be careful when a singleton dimension carries meaning, such as a batch or channel axis. Use [subset()](https://calcul.io/function/subset/index.md) for deliberate selection and [transpose()](https://calcul.io/function/transpose/index.md) when orientation matters.

[All functions](https://calcul.io/functions/index.md)
