Imagine I have matrix A=ones(5). I want to change center of the matrix to 17, A(3,3)=17; In next iteration I want to change all points that are next to this 20 to 5. i will have:
1 1 1 1 11 5 5 5 11 5 17 5 11 5 5 5 11 1 1 1 1In next step i want to change all ones to 10. And so on...10 10 10 10 1010 5 5 5 1010 5 17 5 1010 5 5 5 1010 10 10 10 10Any idea how to do this to large matrix? How to adress only the neighbours but not the points "inside"?
Best Answer