[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Smoothing Functions without distorting matrices' edges
From: |
Przemek Klosowski |
Subject: |
Re: Smoothing Functions without distorting matrices' edges |
Date: |
Mon, 25 Sep 2006 09:20:46 -0400 (EDT) |
This may be slightly OT, but maybe someone may know an easy
function to do this - smooth a matrix without severely
distorting the edges.
Perhaps pad the matrix, and smooth it?
a=[1 2 3; 4 5 6; 7 8 9];
b=zeros(size(a)+2);
b(2:end-1,2:end-1)=a;
Even better, duplicate the edge values before smoothing:
b(2:end-1,1)=a(1:end,1);
b(1,1)=a(1,1)
etc. for the other three edges. By the way, can anyone think of a
simpler way of doing that?