1 function index=findcstr(carray,str)
\r
2 % Searches for a given string in a cell array of strings.
\r
4 % Syntax: (* = optional)
\r
6 % index = findcstr(carray,str);
\r
11 % A cell array of strings
\r
13 % The string to search for.
\r
18 % The element number (in the cell array) of the first occurance.
\r
19 % index=0 means that the given string was not found.
\r
21 % Used by the get/set functions, and will become private after the final
\r
22 % version is created.
\r
24 % Toolbox for nonlinear filtering.
\r
25 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
27 % This program is free software; you can redistribute it and/or
\r
28 % modify it under the terms of the GNU General Public License
\r
29 % as published by the Free Software Foundation; either version 2
\r
30 % of the License, or (at your option) any later version.
\r
32 % This program is distributed in the hope that it will be useful,
\r
33 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
34 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
35 % GNU General Public License for more details.
\r
37 % You should have received a copy of the GNU General Public License
\r
38 % along with this program; if not, write to the Free Software
\r
39 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
41 for i=1:length(carray)
\r
42 if strcmp(carray{i},str)
\r