source: distools/issquare.m @ 19

Last change on this file since 19 was 10, checked in by bduin, 14 years ago
File size: 862 bytes
RevLine 
[10]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 whether feature labels equal object labels.
15% If called without an output argument ISSQUARE generates an error
16% 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  n  = nlabcmp(getfeatlab(d),getlabels(d));
29  OK = (n == 0);
30else
31  OK = 0;
32end
33
34if nargout == 0 & OK == 0
35  error([newline '---- Square dissimilarity matrix expected ----'])
36end
Note: See TracBrowser for help on using the repository browser.