Hello, I am trying to write a function that returns a one dimentional gauss filter. the function took sigma as a parameter. The problem is that the function returns the same array for all sigmas.
function gaussFilter=gauss(sigma)
width = 3 * sigma;
support = (-width :sigma: width);
gaussFilter= exp( - (support).^2 / (2*sigma^2));
gaussFilter = gaussFilter/ sum(gaussFilter);
Note that support array is calculated correctly but the problem arise when applying the exp.