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.
\r
23 % Toolbox for nonlinear filtering.
\r
24 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
26 % This program is free software; you can redistribute it and/or
\r
27 % modify it under the terms of the GNU General Public License
\r
28 % as published by the Free Software Foundation; either version 2
\r
29 % of the License, or (at your option) any later version.
\r
31 % This program is distributed in the hope that it will be useful,
\r
32 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
33 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
34 % GNU General Public License for more details.
\r
36 % You should have received a copy of the GNU General Public License
\r
37 % along with this program; if not, write to the Free Software
\r
38 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
40 for i=1:length(carray)
\r
41 if strcmp(carray{i},str)
\r