Borrar filtros
Borrar filtros

indices of neighbor points and their replacement

1 visualización (últimos 30 días)
Ghulam Murtaza
Ghulam Murtaza el 1 de En. de 2021
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.

Respuestas (0)

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by