| To: | S-news list <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Gaussian kernel |
| From: | Catalina Mesina <cmesina@cs.vu.nl> |
| Date: | Thu, 24 Oct 2002 13:00:09 +0200 |
Hello Dear S+ users:
I would like to make a Gaussian kernel to smooth(convolv) some 2D-images
something that in matlab cab be wrote:
% 2d Gaussian kernel
Dim = [20 20];
fineness = 0.1;
[x2d,y2d] = meshgrid(-(Dim(2)-1)/2:fineness:(Dim(2)-1)/2,...
-(Dim(1)-1)/2:fineness:(Dim(1)-1)/2);
gf = exp(-(x2d.*x2d + y2d.*y2d)/(2*sig*sig));
gf = gf/sum(sum(gf))/(fineness^2);
How can I make this grid of points and the matrix of results without using
"for"?
Thanks for any help,
Catalina Mesina
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: indexing within a list using Splus 2000 and Splus 6, Nick . Ellis |
|---|---|
| Next by Date: | Re: Gaussian kernel, ripley |
| Previous by Thread: | SixSigma at Motorola, Phillip Staford |
| Next by Thread: | Re: Gaussian kernel, ripley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |