source: distools/private/updname.m @ 31

Last change on this file since 31 was 13, checked in by bduin, 14 years ago
File size: 836 bytes
Line 
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
13function name = updname(name)
14
15str = lower(name);
16NAMES = {'distance matrix', 'similarity matrix', 'kernel matrix'};
17
18ok = 0;
19z  = 1;
20while ~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;
36end
37if isempty(name),
38  name = 'Data';
39end
Note: See TracBrowser for help on using the repository browser.