Check if argument is valid connectivity.
If conn is not a valid connectivity argument, gives a properly formatted error message. func is the name of the function to be used on the error message, var the name of the argument being checked (for the error message), and pos the position of the argument in the input.
A valid connectivity argument must be either double or logical. It must also be either a scalar from set [4 6 8 18 26], or a symmetric matrix with all dimensions of size 3, with only 0 or 1 as values, and 1 at its center.
See also: conndef.
Package: image