PRTools contents |
GENLAB
LABELS = GENLAB(N,LABLIST)
Input | |
N | Number of labels to be generated |
LABLIST | Label names (optional; default: numeric labels 1,2,3,...) |
Output | |
LABELS | Labels in a column vector or strinag array |
Generate a set of labels as defined by the LABLIST. N is a number or a row/column vector of the values for each class. If N is a vector, then the first N(i) labels get the value LABLIST(i,:). N should have as many components as LABLIST. If N is a scalar, then N labels are generated for each class. LABLIST is a column vector or a string array. Labels can be used to construct a labeled dataset.
Numeric labels, 1..10, 10 classes, 100 labels per class.
LAB1 = GENLAB(100*ones(1,10));
Character labels, 3 classes, 10 labels per class.
LAB2 = GENLAB([10 10 10], ['A';'B';'C']);
Name labels, 2 classes, 50 labels per class. The commands below are equivalent. LAB3 = GENLAB([50 50], {'Apple'; 'Pear'});
LAB3 = GENLAB([50 50], ['Apple'; 'Pear ']);
PRTools contents |