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 |
|
---|
23 | function OK = issquare(d)
|
---|
24 | isdataset(d);
|
---|
25 | [m,k] = size(d);
|
---|
26 |
|
---|
27 | if 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
|
---|
34 | else
|
---|
35 | OK = 0;
|
---|
36 | end
|
---|
37 |
|
---|
38 | if nargout == 0 & OK == 0
|
---|
39 | error([newline '---- Square dissimilarity matrix expected ----'])
|
---|
40 | end
|
---|
Note: See
TracBrowser
for help on using the repository browser.