MATLAB Examples


Add the cell of names to a string



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.


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);
The value of the parameter "Points_distribution" must be one of those:
 - regular
 - random
 - file

See also


Copyright 2013 Mathieu Gendron