Image Processing Toolbox User's Guide Previous page   Next Page
iptcheckinput

Check validity of array and issue error message if invalid

Syntax

Description

iptcheckinput(A,classes,attributes,func_name,var_name,arg_pos) checks the validity of the array A and issues a formatted error message if it is invalid.

classes is a cell array of strings specifying the set of classes to which A is expected to belong. For example, if you specify classes as {'logical' 'cell'}, A is required to be either a logical array or a cell array. The string 'numeric' is interpreted as an abbreviation for the classes uint8, uint16, uint32, int8, int16, int32, single, and double.

attributes is a cell array of strings specifying the set of attributes that A must satisfy. For example, if attributes is {'real' 'nonempty' 'finite'}, A must be real and nonempty, and it must contain only finite values. The following table lists the supported attributes in alphabetical order.

2d
nonemptyvector
odd
twod
column
nonnan
positive
vector
even
nonnegative
real

finite
nonsparse
row

integer
nonzero
scalar

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

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. iptcheckinput converts this value to an ordinal number and includes this information in the formatted error message.

Example

Create a three-dimensional array.

The following shows the format of the error message and indicates which parts you can customize using iptcheckinput arguments.

See Also

iptcheckhandle, iptcheckmap, iptchecknargin, iptcheckstrs, iptnum2ordinal


Previous page  iptcheckhandle iptcheckmap Next page

© 1994-2005 The MathWorks, Inc.