Rev | Line | |
---|
[13] | 1 | %UPDNAME Update of a distance/similarity dataset
|
---|
| 2 | %
|
---|
| 3 | % NAME = UPDNAME (NAME)
|
---|
| 4 | %
|
---|
| 5 | % A low level routine used in other functions
|
---|
| 6 |
|
---|
| 7 | % Copyright: Elzbieta Pekalska, e.pekalska@ewi.tudelft.nl
|
---|
| 8 | % Faculty EWI, Delft University of Technology
|
---|
| 9 | % P.O. Box 5031, 2600 GA Delft, The Netherlands
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | function name = updname(name)
|
---|
| 14 |
|
---|
| 15 | str = lower(name);
|
---|
| 16 | NAMES = {'distance matrix', 'similarity matrix', 'kernel matrix'};
|
---|
| 17 |
|
---|
| 18 | ok = 0;
|
---|
| 19 | z = 1;
|
---|
| 20 | while ~ok & z<=length(NAMES)
|
---|
| 21 | NAME = NAMES{z};
|
---|
| 22 | m = length(NAME);
|
---|
| 23 | k = findstr(str,NAME);
|
---|
| 24 | if ~isempty(k),
|
---|
| 25 | if length(str) >=k+m+3 & strcmp(str(k+m+1:k+m+3),'for'),
|
---|
| 26 | name(k:k+m+3)=[];
|
---|
| 27 | else
|
---|
| 28 | name(k:k+m-1)=[];
|
---|
| 29 | end
|
---|
| 30 | if ~isempty(name) & strcmp(name(1), ' '),
|
---|
| 31 | name(1)= [];
|
---|
| 32 | end
|
---|
| 33 | ok = 1;
|
---|
| 34 | end
|
---|
| 35 | z = z+1;
|
---|
| 36 | end
|
---|
| 37 | if isempty(name),
|
---|
| 38 | name = 'Data';
|
---|
| 39 | end
|
---|
Note: See
TracBrowser
for help on using the repository browser.