Documentation Center

  • Trial Software
  • Product Updates

iptcheckstrs

Check validity of option string

iptcheckstrs will be removed in a future release. Use validatestring instead.

Syntax

out = iptcheckstrs(in, valid_strs, func_name, var_name, arg_pos)

Description

out = iptcheckstrs(in, valid_strs, func_name, var_name, arg_pos) checks the validity of the option string in. It returns the matching string in valid_strs in out. iptcheckstrs looks for a case-insensitive, nonambiguous match between in and the strings in valid_strs.

valid_strs is a cell array containing strings.

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

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

Examples

To trigger this error message, define a cell array of some text strings and pass in another string that isn't in the cell array.

iptcheckstrs('option3',{'option1','option2'},...
             'func_name','var_name',2)

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

See Also

| | | |

Was this topic helpful?