source: prextra/enableilab.m @ 72

Last change on this file since 72 was 5, checked in by bduin, 14 years ago
File size: 1.1 KB
RevLine 
[5]1%ENABLEILAB - enable named identifiers in a dataset (ilab)
2%
3%    B=ENABLEILAB(A)
4%
5% INPUT
6%    A   input dataset
7%
8% OUTPUT
9%    B   output dataset with initialized ilab structure
10%
11% DESCRIPTION
12% Enables the use of multiple named identifiers in a dataset. For each
13% example in a dataset, multiple identifiers may be defined. Each
14% identifier has a name. The names (identifier labels i.e. ilab) are stored
15% in a ilablist in a user field of a dataset. This function removes all the
16% identifiers stored in a dataset, add one column, called ident, and
17% populates it with unique indices.
18%
19% Technically, ENABLEILAB adds a field ilab to the user structure.  The
20% field names of the ilab stores the column names of the dataset ident
21% cell-array. Other fields of user structure than ilab are not altered.
22%
23% SEE ALSO
24% ADDILAB, REMOVEILAB, GETILAB, SETILAB, GETILABLIST
25
26function a=enableilab(a)
27
28    % reseting the identifiers
29    a.ident=num2cell((1:size(a,1))');
30    prwarning(3,'identifiers were reset in the dataset');
31   
32    ilab.names={'ident'};
33    u.ilab=ilab;
34   
35    a.user=u;
36   
37    return
Note: See TracBrowser for help on using the repository browser.