MATLAB: How to graph this equation: G(a,b)=F(a​,b)-0.15*F​(a-1,b)-0.​15*F(a+1,b​)-0.15*F(a​,b-1)-0.15​*F(a,b+1)

functionsgraph

I have an input matrix for F(a,b) of f =
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 2 2 2 1 1 1
1 1 1 2 2 2 1 1 1
1 1 1 2 2 2 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
but I'm having a hard time figuring out how to graph this G(a,b) output. I'm thinking I'll have to use the mesh command, but having trouble pulling the information from the matrix properly. Any help is appreciated!

Best Answer

G = conv2(F, [0 -0.15 0; -0.15 1 -0.15; 0 -0.15 0], 'same');
surf(G, 'edgecolor', 'none')