Function Reference
— Function File: conn = conndef (num_dims, type)

Creates a connectivity array.

conn=conndef(num_dims,type) creates a connectivity array (CONN) of num_dims dimensions and which type is defined by type as follows:

minimal
Neighbours touch the central element on a (num_dims-1)-dimensional surface.
maximal
Neighbours touch the central element in any way. Equivalent to ones(repmat(3,1,num_dims)).

Demonstration 1

The following code

 conndef(2,'minimal')
 % Create a 2-D minimal connectivity array

Produces the following output

ans =

   0   1   0
   1   1   1
   0   1   0