source: distools/selcdat.m @ 148

Last change on this file since 148 was 10, checked in by bduin, 14 years ago
File size: 907 bytes
Line 
1%SELCDAT Select Class Subset from a Square Dissimilarity Dataset
2%
3%   [DN,J] = SELCDAT(D,C)
4%
5% INPUT
6%   A   NxN Dissimilarity Dataset
7%   C   Indices of classes
8%
9% OUTPUT
10%   DN  Subset of the dataset D
11%   J   Indices of the selected objects
12%
13% DESCRIPTION
14% The classes listed in C (numerically) are extracted for the square
15% dissimilarity matrix D by both, their rows (objects) as well as their
16% columns (features).
17
18% Copyright: R.P.W. Duin, r.p.w.duin@prtools.org, and
19% Elzbieta Pekalska, ela.pekalska@googlemail.com
20% Faculty EWI, Delft University of Technology and
21% School of Computer Science, University of Manchester
22
23
24function [D,J] = selcdat(D,n)
25issquare(D);
26if nargin < 2, return, end
27
28J = [];
29c = getsize(D,3);
30if (any(n > c))
31  error('Not that many classes')
32end
33
34for j=1:length(n)
35  J = [J; findnlab(D,n(j))];
36end
37D = remclass(D(J,J));
38return;
Note: See TracBrowser for help on using the repository browser.