uniformKernel

Uniform kernel

Contents

Syntax

y = uniformKernel(u);
    

Description

uniformKernel(u) returns the result of uniform kernel function for u argument.

The result of a function depends on argument u and is described by following equations:

$$y(u) = \frac{1}{2}$$ for $$|u| \leq 1$$

$$y(u) = 0$$ for $$|u| > 1$$

Input arguments

Examples

Draw graph presented uniform kernel. The input argument is a vector of doubles on the interval ranging from -1.5 to 1.5. Input vector contains 100 equally spaced elements.

u = linspace(-1.5, 1.5);
y = uniformKernel(u);

plot(u, y, '.-');
xlabel('u'); ylabel('y(u)'); title('Uniform kernel');
    

See also

triangularKernel | epanechnikovKernel | gaussianKernel | cosineKernel