This question already has an answer here:
- one Dimensional gauss convolution function in Matlab 2 answers
I have a n-dimensional vector (1xn dataset, and it is not image data), and I want to apply a Gaussian filter to it. I have the Image Processing Toolkit, and a few others (ask if you need a list).
Presumably I can make the hsize
parameter of the fspecial
function something like [1 n]
.
Can I still use imfilter
to apply it to my vector as the next step, or should I be using something else?
I've seen quite a few examples on how to apply a Gaussian filter to two dimensional image data in Matlab, but I'm still relatively new to Matlab as a platform so an example would be really good.
Note: I'm not currently in a position to just try it and see what happens (not currently on a machine with Matlab installed), otherwise I would have tried it first and only asked if I ran into problems using fspecial
and imfilter
.