Rev | Line | |
---|
[10] | 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 |
|
---|
| 24 | function [D,J] = selcdat(D,n)
|
---|
| 25 | issquare(D);
|
---|
| 26 | if nargin < 2, return, end
|
---|
| 27 |
|
---|
| 28 | J = [];
|
---|
| 29 | c = getsize(D,3);
|
---|
| 30 | if (any(n > c))
|
---|
| 31 | error('Not that many classes')
|
---|
| 32 | end
|
---|
| 33 |
|
---|
| 34 | for j=1:length(n)
|
---|
| 35 | J = [J; findnlab(D,n(j))];
|
---|
| 36 | end
|
---|
| 37 | D = remclass(D(J,J));
|
---|
| 38 | return;
|
---|
Note: See
TracBrowser
for help on using the repository browser.