If you want to fill in the corner pixels like the 'replicate' edge treatment does with edges, you can do that by inpainting.
Consider the following examples using an oversize block of pixels to demonstrate the subtle differences:
If you can generate a binary mask representing the pixels you want to inpaint, you can then use inpaintCoherent()
inpict = imread('cameraman.tif');
mask = false(size(inpict));
A = inpaintCoherent(inpict,mask);
If you don't have a new enough version to have that, you can use inpaint_nans() from the File Exchange, and instead of using a binary mask, use a copy of the image with the corner pixels set to NaN.
inpict = imread('cameraman.tif');
mask = false(size(inpict));
nanpict = im2double(inpict);
B = inpaint_nans(nanpict,2);
Although inpaintCoherent() has more convenient usage, I don't really think it's nearly as useful as John's inpaint_nans().
That said, if we're only talking about single pixels, I doubt the difference matters. It would probably suffice to just fill them with the average of their neighbors. For this example, I'm just going to consider the same 50x50 block of pixels. You'd have to apply this to each corner.
inpict = imread('cameraman.tif');
mask = false(size(inpict));
neighbors = imdilate(mask,ones(2)) & ~mask;
C(mask) = mean(C(neighbors));