extract the matrix from strel matlab
matlab
Solution
Use the STREL object's getnhood() function:
SE.getnhood()
ans =
0 0 1 0 0
0 1 1 1 0
1 1 1 1 1
0 1 1 1 0
0 0 1 0 0
Problem
I am trying to use the strel function from matlab, and get its matrix value alone. When I define a strel object, as follows, ``` SE = strel('disk',2); ``` I get the following ``` SE SE = Flat STREL object containing 13 neighbors. Neighborhood: 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 ``` But when I try to use it as a matrix, am getting error. Is there a way where I can just extract the matrix part of this object? Please help me.