annotate scripts/strings/strmatch.m @ 20164:df437a52bcaf stable

doc: Update more docstrings to have one sentence summary as first line. Reviewed miscellaneous, sparse, strings in scripts directory. * scripts/miscellaneous/bzip2.m, scripts/miscellaneous/citation.m, scripts/miscellaneous/compare_versions.m, scripts/miscellaneous/computer.m, scripts/miscellaneous/debug.m, scripts/miscellaneous/dir.m, scripts/miscellaneous/edit.m, scripts/miscellaneous/error_ids.m, scripts/miscellaneous/fileattrib.m, scripts/miscellaneous/fullfile.m, scripts/miscellaneous/genvarname.m, scripts/miscellaneous/gzip.m, scripts/miscellaneous/mkoctfile.m, scripts/miscellaneous/news.m, scripts/miscellaneous/open.m, scripts/miscellaneous/parseparams.m, scripts/miscellaneous/recycle.m, scripts/miscellaneous/run.m, scripts/miscellaneous/swapbytes.m, scripts/miscellaneous/tar.m, scripts/miscellaneous/tmpnam.m, scripts/miscellaneous/unpack.m, scripts/miscellaneous/what.m, scripts/sparse/bicg.m, scripts/sparse/bicgstab.m, scripts/sparse/cgs.m, scripts/sparse/colperm.m, scripts/sparse/eigs.m, scripts/sparse/etreeplot.m, scripts/sparse/gmres.m, scripts/sparse/gplot.m, scripts/sparse/ichol.m, scripts/sparse/ilu.m, scripts/sparse/pcg.m, scripts/sparse/pcr.m, scripts/sparse/qmr.m, scripts/sparse/spaugment.m, scripts/sparse/spconvert.m, scripts/sparse/spdiags.m, scripts/sparse/spfun.m, scripts/sparse/spones.m, scripts/sparse/sprandsym.m, scripts/sparse/spstats.m, scripts/sparse/spy.m, scripts/sparse/svds.m, scripts/sparse/treelayout.m, scripts/sparse/treeplot.m, scripts/strings/base2dec.m, scripts/strings/bin2dec.m, scripts/strings/blanks.m, scripts/strings/cstrcat.m, scripts/strings/deblank.m, scripts/strings/dec2base.m, scripts/strings/dec2bin.m, scripts/strings/dec2hex.m, scripts/strings/findstr.m, scripts/strings/hex2dec.m, scripts/strings/index.m, scripts/strings/isletter.m, scripts/strings/isstrprop.m, scripts/strings/mat2str.m, scripts/strings/ostrsplit.m, scripts/strings/regexptranslate.m, scripts/strings/rindex.m, scripts/strings/str2num.m, scripts/strings/strcat.m, scripts/strings/strchr.m, scripts/strings/strjoin.m, scripts/strings/strjust.m, scripts/strings/strmatch.m, scripts/strings/strsplit.m, scripts/strings/strtok.m, scripts/strings/strtrim.m, scripts/strings/strtrunc.m, scripts/strings/substr.m, scripts/strings/untabify.m, scripts/time/datenum.m: Update more docstrings to have one sentence summary as first line.
author Rik <rik@octave.org>
date Mon, 04 May 2015 14:22:02 -0700
parents bcf0a288aa6c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19956
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 ## Copyright (C) 2000-2013 Paul Kienzle
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 ## Copyright (C) 2003 Alois Schloegl
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 ## Copyright (C) 2010 VZLU Prague
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 ## This file is part of Octave.
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 ## Octave is free software; you can redistribute it and/or modify it
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 ## under the terms of the GNU General Public License as published by
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 ## the Free Software Foundation; either version 3 of the License, or (at
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 ## your option) any later version.
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 ## Octave is distributed in the hope that it will be useful, but
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 ## General Public License for more details.
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 ## You should have received a copy of the GNU General Public License
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 ## along with Octave; see the file COPYING. If not, see
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 ## <http://www.gnu.org/licenses/>.
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 ## -*- texinfo -*-
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 ## @deftypefn {Function File} {} strmatch (@var{s}, @var{A})
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 ## @deftypefnx {Function File} {} strmatch (@var{s}, @var{A}, "exact")
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 ## Return indices of entries of @var{A} which begin with the string @var{s}.
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20139
diff changeset
25 ##
19956
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 ## The second argument @var{A} must be a string, character matrix, or a cell
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20139
diff changeset
27 ## array of strings.
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20139
diff changeset
28 ##
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20139
diff changeset
29 ## If the third argument @qcode{"exact"} is not given, then @var{s} only
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20139
diff changeset
30 ## needs to match @var{A} up to the length of @var{s}. Trailing spaces and
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20139
diff changeset
31 ## nulls in @var{s} and @var{A} are ignored when matching.
19956
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 ## For example:
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 ## @example
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 ## @group
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 ## strmatch ("apple", "apple juice")
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 ## @result{} 1
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 ## strmatch ("apple", ["apple "; "apple juice"; "an apple"])
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 ## @result{} [1; 2]
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 ## strmatch ("apple", ["apple "; "apple juice"; "an apple"], "exact")
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 ## @result{} [1]
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 ## @end group
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 ## @end example
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 ##
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 ## @strong{Caution:} @code{strmatch} is scheduled for deprecation. Use
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 ## @code{strncmp} (normal case), or @code{strcmp} (@qcode{"exact"} case), or
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 ## @code{regexp} in all new code.
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 ## @seealso{strfind, findstr, strcmp, strncmp, strcmpi, strncmpi, find}
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 ## @end deftypefn
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 ## Author: Paul Kienzle, Alois Schloegl
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 ## Adapted-by: jwe
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 function idx = strmatch (s, A, exact)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 if (nargin < 2 || nargin > 3)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 print_usage ();
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 if (! ischar (s) || (! isempty (s) && ! isvector (s)))
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 error ("strmatch: S must be a string");
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 elseif (! (ischar (A) || iscellstr (A)))
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 error ("strmatch: A must be a string or cell array of strings");
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 ## Trim blanks and nulls from search string
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 s = regexprep (s, "[ \\0]+$", '');
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 len = length (s);
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 exact = nargin == 3 && ischar (exact) && strcmp (exact, "exact");
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 if (ischar (A))
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 [nr, nc] = size (A);
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 if (len > nc)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 idx = [];
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 else
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 match = all (bsxfun (@eq, A(:,1:len), s), 2);
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 if (exact)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 AA = A(:,len+1:nc);
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 match &= all (AA == " " | AA == "\0", 2);
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 idx = find (match);
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 else
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 if (len > 0)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 idx = find (strncmp (s, A, len));
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 else
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 idx = find (strcmp (s, A));
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 if (exact)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 ## We can't just use strcmp, because we need to ignore spaces at end.
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 B = regexprep (A(idx), "[ \\0]+$", '');
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 idx = idx(strcmp (s, B));
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 endif
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 endfunction
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 %!assert (strmatch ("a", {"aaa", "bab", "bbb"}), 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 %!assert (strmatch ("apple", "apple juice"), 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 %!assert (strmatch ("apple", ["apple pie"; "apple juice"; "an apple"]), [1; 2])
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 %!assert (strmatch ("apple", {"apple pie"; "apple juice"; "tomato"}), [1; 2])
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 %!assert (strmatch ("apple pie", "apple"), [])
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 %!assert (strmatch ("a ", "a"), 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 %!assert (strmatch ("a", "a \0", "exact"), 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 %!assert (strmatch ("a b", {"a b", "a c", "c d"}), 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 %!assert (strmatch ("", {"", "foo", "bar", ""}), [1, 4])
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 %!assert (strmatch ('', { '', '% comment', 'var a = 5', ''}, 'exact'), [1,4])
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 %% Test input validation
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 %!error <Invalid call to strmatch> strmatch ()
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 %!error <Invalid call to strmatch> strmatch ("a")
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 %!error <Invalid call to strmatch> strmatch ("a", "aaa", "exact", 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 %!error <S must be a string> strmatch (1, "aaa")
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 %!error <S must be a string> strmatch (char ("a", "bb"), "aaa")
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 %!error <A must be a string> strmatch ("a", 1)
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 %!error <A must be a string> strmatch ("a", {"hello", [1]})
55c2d33e6773 restore strmatch function; backout changeset edf5d63c82e1
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122