MATLAB: How to set the NHOOD variable.

Image Processing Toolboxstructuring element

My matlab code is below
rgb1 = imread(name);
rgb=imresize(rgb1,[512 512]);
I = rgb2gray(rgb);
hy = fspecial('prewitt');
hx = hy';
Iy = imfilter(double(I), hy, 'replicate');
Ix = imfilter(double(I), hx, 'replicate');
gradmag = sqrt(Ix.^2 + Iy.^2);
L = watershed(gradmag);
se = strel('arbitrary', NHOOD);
Now I set the NHOOD variable into default as in Matlab Help file [100;100;101]. I want to know is this true and can I do that. If any simple ways how can i set to this variable. Please suggest me …! Thanks

Best Answer

The ‘NHOOD’ variable is a matrix, not a vector. You need to put spaces or commas (or both) between the numbers:
NHOOD=[1, 0, 0; 1, 0, 0; 1, 0, 1];