Possible to apply filter2 to only values above a limit?
Show older comments
I have an array which I'm attempting to filter with a Gaussian blur to smooth the surface and contour plots. Without any filtering, this is the resulting contour plot:

This code:
load 'A'
G=fspecial('gaussian',[5 5],2);
Af=filter2(G,A,'same');
contour(X,Y,A);
Gives the following contour plot:

As you can see, the contours are nicely smoothed, but the filter has blurred the transitions too much and shifted them wider and outwards.
My Question:
Is it possible to refer to just array elements above a certain value for the filtering?
I'm sure it must be and I'm just being stupid not figuring it out.
Cheers
Accepted Answer
More Answers (1)
Josh
on 2 Mar 2014
0 votes
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!