PRTools Contents

PRTools User Guide



Generate labels for classes


 N Number of labels to be generated
 LABLIST Label names (optional; default: numeric labels 1,2,3,...)

 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 ']);

See also

datasets, dataset,

PRTools Contents

PRTools User Guide

This file has been automatically generated. If badly readable, use the help-command in Matlab.