MATLAB Examples

errmsg_w_list_of_names

Add the cell of names to a string

Contents

Description

This function is to be used to create error message when specific values are required.

str_out = errmsg_w_list_of_names(str_init,C_names) returns the error message str_out, composed of the string str_init as the first part of the message and the string elements of C_names.

Input parameters

str_init: First part of the output string. It should explain the error.

C_names: m x1 or 1x m cell array of strings.

Output parameters

errmsg: Complete error message to display.

Examples

str_init = 'The value of the parameter "Points_distribution" must be one of those:';
C_names = {'regular' 'random' 'file'};
str_out = errmsg_w_list_of_names(str_init,C_names);
disp(str_out)
The value of the parameter "Points_distribution" must be one of those:
 - regular
 - random
 - file

See also

check_ismember

Copyright 2013 Mathieu Gendron