I was able to create something like what I was looking for. I tried heatmap and pcolor, but imagesc got me what I wanted, I think.
A = -5:5;
B = -5:5;
objx = A';
objy = B';
ux = repelem(objx,11,1);
ux = ux(:);
uy = repelem(objy,1,11);
uy = uy(:);
imgx = ux + (2*rand(size(ux)) - 1)*0.1;
imgy = uy + (2*rand(size(uy)) - 1)*0.1;
%imgx = ux + (rand(size(ux)))*0.1;
%imgy = uy + (rand(size(uy)))*0.1;
robj = sqrt(ux.^2 + uy.^2);
rimg = sqrt(imgx.^2 + imgy.^2);
delr = rimg-robj;
%pcolor(delr);
diff = zeros(11);
i = 1;
for x = A
for y = B
robj = sqrt(ux(i).^2 + uy(i).^2);
rimg = sqrt(imgx(i).^2 + imgy(i).^2);
diff(x+6,y+6) = rimg-robj;
% diff(x+6,y+6) = sqrt((ux(i) - imgx(i)).^2 + (uy(i) - imgy(i)).^2);
i = i+1;
end
end
% figure
% pcolor(diff);
figure
scatter(ux,uy);
hold on
scatter(imgx,imgy);
% figure
% heatmap(diff);
figure
imagesc(diff);
colormapeditor
save('CustomColormap','CustomColormap');