# trimdata

## Description

trims `B`

= trimdata(`A`

,`m`

)`A`

to size `m`

by removing elements from the
trailing side of `A`

. For example, for a scalar size `m`

:

If

`A`

is a vector, then`trimdata(A,m)`

trims`A`

to length`m`

.If

`A`

is a matrix, table, or timetable, then`trimdata(A,m)`

trims`A`

to have`m`

rows.If

`A`

is a multidimensional array, then`trimdata(A,m)`

trims`A`

to the size specified by`m`

along the first dimension whose size is greater than 1.

If `m`

is greater than or equal to the size of `A`

in
the operating dimension, then `trimdata`

returns all of
`A`

.

specifies additional parameters for trimming using one or more name-value arguments. For
example, `B`

= trimdata(`A`

,`m`

,`Name=Value`

)`trimdata(A,m,Side="leading")`

trims by removing elements from the
beginning of `A`

.

## Examples

## Input Arguments

## Tips

`trimdata`

only removes elements from the input data.`trimdata`

is recommended if you do not want to add additional data and you do not require the resized data to match the target size. If you require the resized data to respect the specified sizes in`m`

, then consider using the`resize`

function, which can also add elements to your data.

## Version History

**Introduced in R2023b**