Rev | Line | |
---|
[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 |
|
---|
| 23 | function OK = issquare(d)
|
---|
| 24 | isdataset(d);
|
---|
| 25 | [m,k] = size(d);
|
---|
| 26 |
|
---|
| 27 | if m == k
|
---|
| 28 | n = nlabcmp(getfeatlab(d),getlabels(d));
|
---|
| 29 | OK = (n == 0);
|
---|
| 30 | else
|
---|
| 31 | OK = 0;
|
---|
| 32 | end
|
---|
| 33 |
|
---|
| 34 | if nargout == 0 & OK == 0
|
---|
| 35 | error([newline '---- Square dissimilarity matrix expected ----'])
|
---|
| 36 | end
|
---|
Note: See
TracBrowser
for help on using the repository browser.