Clear Filters
Clear Filters

indices of neighbor points and their replacement

1 view (last 30 days)
Hi, I have matrix A=[3,4,8,6;1,6,9,0;2,5,7,1], and code to find neighbors of central points is as: M = zeros(size(A)); M(2,2) = 1; % location
nhb=A(conv2(M,[1,1,1;1,0,1;1,1,1],'same')>0).
>> nhb=[3,1,2,4,5,8,9,7]
My question is how i can find indices of eight neighbors of cntral point and replace them with B=[2,5,6,9,10,23,45,83] points.

Answers (0)

Products


Release

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!