Check validity of connectivity argument


iptcheckconn(conn, func_name, var_name, arg_pos)


iptcheckconn(conn, func_name, var_name, arg_pos) checks whether conn is a valid connectivity argument. If it is invalid, the function issues a formatted error message.

This function supports code generation (see ).

A connectivity argument can be one of the following scalar values: 1, 4, 6, 8, 18, or 26. A connectivity argument can also be a 3-by-3-by- ... -by-3 array of 0's and 1s. The central element of a connectivity array must be nonzero and the array must be symmetric about its center.

func_name is a string that specifies the name used in the formatted error message to identify the function checking the connectivity argument.

var_name is a string that specifies the name used in the formatted error message to identify the argument being checked.

arg_pos is a positive integer that indicates the position of the argument being checked in the function argument list. iptcheckconn includes this information in the formatted error message.

Code Generation support: Yes.

MATLAB Function Block support: Yes.

Class Support

conn must be of class double or logical and must be real and nonsparse.


Create a 4-by-4 array and pass it as the connectivity argument.

iptcheckconn(eye(4), 'func_name','var_name',2)

More About

expand all

Code Generation

This function supports the generation of C code using MATLAB® Coder™. For more information, see Code Generation for Image Processing.

When generating code, all input arguments must be compile-time constants.

MATLAB Function Block

You can use this function in the MATLAB Function Block in Simulink.

Introduced before R2006a

Was this topic helpful?