CLIP2

CLIP2 limits the values in an array.
372 download
Aggiornato 17 nov 2011

Visualizza la licenza

CLIP2 limits the values in an array
Y = CLIP2(A,x_min,x_max) generates an array Y where values outside
the limits (x_min, x_max) are clipped to interval edges. A is a matrix
and x_min and x_max are scalar values. The size of Y is the same size
as A.

Y = CLIP2(A,x_min,x_max,'DisplayAsNans') is like CLIP2(A,x_min,x_max)
but values outside the limits are replaced to nans.

For example,
x = (1:100)'; x_min = 15; x_max = 47;
y = clip2(x,x_min,x_max)

x = ceil(100*rand(10)); x_min = 5; x_max = 25;
y = clip2(x,x_min,x_max)

t = (0:1e-2:5)'; x = 3.5*sin(2*pi*t); x_min =
0; x_max = max(x); y =clip2(x,x_min,x_max,'DisplayAsNans')

CLIP2 is a modification from NUMPY's (Python extension module)
clip function.

Cita come

Mikko Leppänen (2025). CLIP2 (https://it.mathworks.com/matlabcentral/fileexchange/33808-clip2), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2009a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Random Number Generation in Help Center e MATLAB Answers
Riconoscimenti

Ispirato: clip

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