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
Ais a vector, thentrimdata(A,m)trimsAto lengthm.If
Ais a matrix, table, or timetable, thentrimdata(A,m)trimsAto havemrows.If
Ais a multidimensional array, thentrimdata(A,m)trimsAto the size specified bymalong the first dimension whose size does not equal 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
Name-Value Arguments
Tips
trimdataonly removes elements from the input data.trimdatais 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 inm, then consider using theresizefunction, which can also add elements to your data.
Extended Capabilities
Version History
Introduced in R2023b