Windowing after filtering a discrete signal to get it back to its original length
You cannot "really" apply a window whose length is different from the size of the signal, since it resorts to a sample-wise product. However, you can for instance apply a composite window, made of a standard window $w$ for the first $N$ samples, and filled with zeros for the remaining samples (to the right). If $w$ is a rectangular window, you get with conv.m what you would have with filter.m, plus the flat tail, as explained by @MattL; the red lines (filter.m) and blue crosses (conv.m) are matching perfectly:



Of course,  you could use a non-rectangular window (here the Hann), and you get a nicer apodization at the edges (the signal is flattened to $0$), but you could as well window the output of filter.m