# HG changeset patch # User jwe # Date 1109830907 0 # Node ID 5b361aa47dffd72192e2a22c43ba116c8d0b06b8 # Parent 41cd70503c72597ed8c8b0c5181b1d0d3e624af9 [project @ 2005-03-03 06:21:47 by jwe] diff -r 41cd70503c72 -r 5b361aa47dff scripts/general/isequal.m --- a/scripts/general/isequal.m Thu Mar 03 05:49:55 2005 +0000 +++ b/scripts/general/isequal.m Thu Mar 03 06:21:47 2005 +0000 @@ -17,8 +17,11 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## isequal(x1, x2, ...) -## true if all parts of x1, x2, ... are equal +## -*- texinfo -*- +## @deftypefn {Function File} {} isequal (@var{x1}, @var{x2}, @dots{}, @var{xN}) +## Return true if all parts of @var{x1}, @var{x2}, @dots{}, @var{xN} are +## equal. +## @end deftypefn ## Author: Paul Kienzle ## Adapted-by: jwe diff -r 41cd70503c72 -r 5b361aa47dff scripts/general/sortrows.m --- a/scripts/general/sortrows.m Thu Mar 03 05:49:55 2005 +0000 +++ b/scripts/general/sortrows.m Thu Mar 03 06:21:47 2005 +0000 @@ -17,15 +17,12 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## B = sortrows (A) -## returns matrix with rows sorted "lexicographically" -## -## B = sortrows(A, c) -## returns matrix with rows sorted according to the order of the -## columns specified in c. -## -## Set implicit_str_to_num_ok and implicit_num_to_str_ok to 1 if you -## use this for string sorting and octave 2.1.50 or earlier. +## -*- texinfo -*- +## @deftypefn {Function File} {} sortrows (@var{a}, @var{c}) +## Sort the rows of the matrix @var{a} according to the order of the +## columns specified in @var{c}. If @var{c} is omitted, a +## lexicographical sort is used. +## @end deftypefn ## Author: Daniel Calvelo, Paul Kienzle ## Adapted-by: jwe diff -r 41cd70503c72 -r 5b361aa47dff scripts/set/ismember.m --- a/scripts/set/ismember.m Thu Mar 03 05:49:55 2005 +0000 +++ b/scripts/set/ismember.m Thu Mar 03 06:21:47 2005 +0000 @@ -18,11 +18,9 @@ ## 02111-1307, USA. ## -*- texinfo -*- -## @deftypefn {Function File} {} ismember(@var{A}, @var{S}) -## +## @deftypefn {Function File} {} ismember (@var{A}, @var{S}) ## Return a matrix the same shape as @var{A} which has 1 if ## @code{A(i,j)} is in @var{S} or 0 if it isn't. -## ## @end deftypefn ## @seealso{unique, union, intersect, setxor, setdiff} diff -r 41cd70503c72 -r 5b361aa47dff scripts/set/setdiff.m --- a/scripts/set/setdiff.m Thu Mar 03 05:49:55 2005 +0000 +++ b/scripts/set/setdiff.m Thu Mar 03 06:21:47 2005 +0000 @@ -18,12 +18,10 @@ ## 02111-1307, USA. ## -*- texinfo -*- -## @deftypefn {Function File} {} setdiff(@var{a}, @var{b}) -## -## Return the elements in @var{a} but not in @var{b}, sorted in ascending -## order. If @var{a} and @var{b} are both column vectors return a column -## vector, otherwise return a row vector. -## +## @deftypefn {Function File} {} setdiff (@var{a}, @var{b}) +## Return the elements in @var{a} but not in @var{b}, sorted in +## ascending order. If @var{a} and @var{b} are both column vectors +## return a column vector, otherwise return a row vector. ## @end deftypefn ## @seealso{unique, union, intersect, setxor, ismember} @@ -38,13 +36,13 @@ c = unique (a); if (! isempty (c) && ! isempty (b)) - ## form a and b into combined set + ## Form a and b into combined set. b = unique (b); [dummy, idx] = sort ([c(:); b(:)]); - ## eliminate those elements of a that are the same as in b + ## Eliminate those elements of a that are the same as in b. n = length (dummy); c(idx(find (dummy(1:n-1) == dummy(2:n)))) = []; - ## reshape if necessary + ## Reshape if necessary. if (size (c, 1) != 1 && size (b, 1) == 1) c = c.'; endif diff -r 41cd70503c72 -r 5b361aa47dff scripts/strings/strmatch.m --- a/scripts/strings/strmatch.m Thu Mar 03 05:49:55 2005 +0000 +++ b/scripts/strings/strmatch.m Thu Mar 03 06:21:47 2005 +0000 @@ -18,11 +18,14 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: strmatch(s, A [, 'exact']) -## Determines which entries of A match string s. A can be a string matrix -## or a cell array of strings. If 'exact' is not given, then s only needs -## to match A up to the length of s. Null characters match blanks. -## Results are returned as a column vector. +## -*- texinfo -*- +## @deftypefn {Function File} {} strmatch (@var{s}, @var{a}, "exact") +## Return true for entries of @var{a} that match the string @var{s}. +## The second argument @var{a} may be a string matrix or a cell array of +## strings. If the third argument @code{"exact"} is not given, then +## @var{s} only needs to match @var{a} up to the length of @var{s}. Nul +## characters match blanks. Results are returned as a column vector. +## @end deftypefn ## Author: Paul Kienzle, Alois Schloegl ## Adapted-by: jwe @@ -40,12 +43,12 @@ if (nargin > 2) for k = 1:nel match(k) = strcmp (s, A{k}); - end + endfor else for k = 1:nel match(k) = strncmp (s, A{k}, length (s)); - end - end + endfor + endif idx = find (match); elseif (length (s) > nc) idx = [];