Check validity of connectivity argument
iptcheckconn(
checks if conn
,func_name
,var_name
,arg_pos
)conn
is a valid pixel connectivity
and issues a formatted error message if the connectivity is
invalid.
If the connectivity is valid, then
iptcheckconn
returns nothing.
Valid connectivities are one of these scalar values:
1, 4, 6, 8, 18, or 26. A connectivity can also be a
3-by-3-by- ... -by-3 array of 0
s
and 1
s. The central element of a
connectivity array must be nonzero and the array
must be symmetric about its center.
If the connectivity is invalid, then
iptcheckconn
issues a formatted
error message that includes information about the
function name (func_name
), the
variable name (var_name
), and
the argument position
(arg_pos
). These values are
used only to create the error message, not to check
whether the pixel connectivity is valid.
Create a 4-by-4 array and pass it as the connectivity argument.
iptcheckconn(eye(4),'myfun','myvar',2)
eye(4)
is not a valid pixel connectivity so
iptcheckconn
returns an error
message:
Function MYFUN expected input number 2, myvar, to be a valid connectivity specifier. A nonscalar connectivity specifier must be 3-by-3-by- ... -by-3.