source: distools/issquare.m @ 41

Last change on this file since 41 was 20, checked in by bduin, 13 years ago

updates for handling soft labels

File size: 943 bytes
Line 
1%ISSQUARE Test on square dissimilarity matrix
2%
3%   OK = ISSQUARE(D)
4%   ISSQUARE(D)
5%
6% INPUT
7%   D      Dataset
8%
9% OUTPUT
10%   OK     1 if the matrix D is square and 0, otherwise.
11%
12% DESCRIPTION
13% True is D is a square dissimilarity matrix dataset. This includes
14% the check (in case of crisp dataset D) whether feature labels equal
15% object labels. If called without an output argument ISSQUARE generates an
16% error if D is not square.
17
18% Copyright: Elzbieta Pekalska, ela.pekalska@googlemail.com
19% Faculty EWI, Delft University of Technology and
20% School of Computer Science, University of Manchester
21
22
23function OK = issquare(d)
24isdataset(d);
25[m,k] = size(d);
26
27if m == k
28        if islabtype(d,'crisp')
29                n  = nlabcmp(getfeatlab(d),getlabels(d));
30                OK = (n == 0);
31        else
32                OK = 1;
33        end
34else
35  OK = 0;
36end
37
38if nargout == 0 & OK == 0
39  error([newline '---- Square dissimilarity matrix expected ----'])
40end
Note: See TracBrowser for help on using the repository browser.