conv
Discrete convolution.
Syntax
Section titled “Syntax”w = conv(u, v)w = conv(u, v, shape)Description
Section titled “Description”Returns the discrete convolution of vectors u and v — the linear combination of shifted, scaled copies. Result length is length(u) + length(v) - 1 for shape = 'full' (default).
The shape argument controls the output size:
'full'— entire convolution (default)'same'— center section, same length asu'valid'— only points where the kernel fully overlapsu
When the first argument is a graph handle, returns the convolution of the graph’s data points (used in chart-context analysis).
Examples
Section titled “Examples”conv([1 1 1], [1 2 3]) % [1 3 6 5 3]conv([1 1 1], [1 2 3], 'same') % [3 6 5]conv([1 0 0 0 0], [0.5 0.5]) % impulse → 2-tap moving average