source: prdatasets/pr_dset_align.m @ 149

Last change on this file since 149 was 142, checked in by bduin, 5 years ago

Updated collection of datasets

File size: 766 bytes
Line 
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%
8% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>
9% DATASETS, SETFEATDOM, FEATTYPES, DSET2CELL, CELL2DSET
10
11% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
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.