clip

Return the values of an array within a given range, optionally return corresponding clipped arrays.
1,3K download
Aggiornato 19 ago 2013

Visualizza la licenza

clip(x,xmin,xmax,varargin) returns a clipped or trimmed array containing only the values of x between xmin and xmax, inclusive. Inclusion of any other arrays as inputs returns corresponding clipped arrays. The optional argument 'exclusive' can be included to return only values between but not including xmin and xmax.

INPUTS AND OUTPUTS:

xclp = clip(x,xmin,xmax) returns an array of all values in x from xmin to xmax, inclusive.

xclp = clip(x,xmin,xmax,'exclusive') returns an array of all values in x from xmin to xmax, exclusive.

[xclp,ind] = clip(x,xmin,xmax) returns an array of all values in x from xmin to xmax, and also returns the indices of x corresponding to xclp. Note that xclp = x(ind).

[xclp,yclp] = clip(x,xmin,xmax,y) returns xclp and corresponding clipped values of the array y, which should be the same length as x.

[xclp,y1clp,y2clp,...,ynclp] = clip(x,xmin,xmax,y1,y2,...yn) returns clipped arrays of x and y1 through yn.

[xclp,y1clp,y2clp,...,ynclp,ind] = clip(x,xmin,xmax,y1,y2,...yn) returns clipped arrays of x and y1 through yn and corresponding indices ind. xclp = x(ind) and y1clp = y1(ind) and so on.

In the example image above, y1 through y4 were declared, and with an interest in values from x=70 to x=90, the clipped x and y arrays were found like this:

[xc,y1c,y2c,y3c,y4c] = clip(x,70,90,y1,y2,y3,y4);

Cita come

Chad Greene (2025). clip (https://it.mathworks.com/matlabcentral/fileexchange/43131-clip), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2012b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Structures in Help Center e MATLAB Answers
Tag Aggiungi tag
Riconoscimenti

Ispirato da: CLIP2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0