source: prdatasets/pr_dset_align.m @ 158

Last change on this file since 158 was 150, checked in by bduin, 5 years ago
File size: 751 bytes
RevLine 
[142]1%PR_DSET_ALIGN Align dataset w.r.t. categorical data
2%
3%   [A,B, ...} = PR_DSET_ALIGN(A,B, ...)
4%
5% Align datasets (partially) based on categorical data. Without a call to
6% this routine they might be coded differently.
7%
[150]8% SEE ALSO <a href="http://prtools.tudelft.nl/prtools/">PRTools Guide</a>
[142]9% DATASETS, SETFEATDOM, FEATTYPES, DSET2CELL, CELL2DSET
10
[150]11% Copyright: R.P.W. Duin
[142]12
13function varargout = pr_dset_align(varargin)
14
15varargout = cell(1,nargin);
16
17a = varargin{1};
18isdataset(a);
19m = zeros(1,nargin);
20m(1) = size(a,1);
21
22for j=2:nargin
23  b = varargin{j};
24  a = [a;b];
25  m(j) = size(b,1);
26end
27
28n = 1;
29for j=1:nargin
30  b = a(n:sum(m(1:j)),:);
31  varargout{j} = setname(b,getname(varargin{j}));
32  n = n+m(j);
33end
34
35
Note: See TracBrowser for help on using the repository browser.