Main Content

iptcheckmap

Check validity of colormap

Description

example

iptcheckmap(map,func_name,var_name,arg_pos) checks the validity of the colormap map and issues a formatted error message if the colormap is invalid.

  • If the colormap is valid, then iptcheckmap returns nothing.

  • If the colormap is invalid, then iptcheckmap 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 array is valid.

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

Formatted error message that includes a function name, argument position, and variable name.

Examples

collapse all

bad_map = ones(10);
iptcheckmap(bad_map,"myfun","var_name",2)
Function MYFUN expected input number 2, var_name, to be a valid colormap. Valid
colormaps must be nonempty, double, 2-D matrices with 3 columns.

Input Arguments

collapse all

Colormap, specified as a numeric array.

Function name to include in an error message when map is an invalid colormap, specified as a character vector or string scalar.

Data Types: char | string

Variable name to include in an error message when map is an invalid colormap, specified as a character vector or string scalar.

Data Types: char | string

Argument position to include in an error message when map is an invalid colormap, specified as a positive integer.

Extended Capabilities

Version History

Introduced before R2006a