This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

iptcheckmap

Check validity of colormap

Syntax

iptcheckmap(map,func_name,var_name,arg_pos)

Description

example

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

  • If the colomap 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.

Examples

Trigger Error For Invalid Colormap

bad_map = ones(10);
iptcheckmap(bad_map,'func_name','var_name',2)
Function FUNC_NAME 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

Introduced before R2006a