fprintf('Beginning to run %s.m ...\n', mfilename);
y = [
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0, ...
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0, ...
0 0 0 0 0 0 0 0 0]
yMax = movmax(y, 5)
props = regionprops(yMax > 0, 'PixelIdxList')
for k = 1 : length(props)
fprintf('\nFor block #%d, indexes = ', k);
indexes{k} = props(k).PixelIdxList;
fprintf('%d ', indexes{k});
end
fprintf('\nDone running %s.m ...\n', mfilename);
25 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087848
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087848
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087903
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087903
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087913
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087913
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087973
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1087973
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1088768
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1088768
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1088773
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1088773
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1088993
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1088993
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089213
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089213
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089353
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089353
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089388
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089388
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089403
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089403
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089453
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089453
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089498
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089498
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089688
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089688
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089758
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089758
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089898
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089898
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089953
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089953
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089988
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1089988
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1090268
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1090268
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1090353
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1090353
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1090938
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1090938
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1091578
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1091578
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1118565
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1118565
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1145718
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1145718
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1185533
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/626663-find-sorrunding-elements-and-element-from-an-array#comment_1185533
Sign in to comment.