~ubuntu-branches/ubuntu/wily/octave-miscellaneous/wily

« back to all changes in this revision

Viewing changes to inst/grep.m

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Rafael Laboissiere, Sébastien Villemot
  • Date: 2012-10-17 13:40:55 UTC
  • mfrom: (1.2.1) (12 sid)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: package-import@ubuntu.com-20121017134055-vatltexghy77fnv7
Tags: 1.2.0-1
[ Rafael Laboissiere ]
* Imported Upstream version 1.2.0
* Bump Standards-Version to 3.9.4 (no changes needed)
* Refresh for new upstream release
* Use Sébastien Villemot's @debian.org email address
* Remove obsolete DM-Upload-Allowed flag
* Add patch autoload-yes.patch
* Add copyright info for file lauchli.m (included in a Debian patch)
* Add patch partcnt-test-succeeds.patch
* Build-depends on octave-pkg-dev >= 1.0.3

[ Sébastien Villemot ]
* debian/control: fix versioned dependency on debhelper
* Add lintian override for false positive on hardening (fortify)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## -*- texinfo -*-
2
 
## @deftypefn{Function File} {@var{[y,f]} = } grep ( x ) 
3
 
## @cindex  
4
 
## This function is just to save typing and improve 
5
 
## readability, as in foo(find(foo(:,p)),p) vs. grep(foo(:,p))
6
 
##
7
 
## You can use grep as follows,
8
 
## @example
9
 
## y = grep(x) = x(find(x))
10
 
## [y,f] = [x(find(x)),find(x)]
11
 
## @end example
12
 
## @seealso{find,strfind}
13
 
## @end deftypefn
14
 
 
15
 
## Author:        Etienne Grossmann <etienne@cs.uky.edu>
16
 
## Last modified: October 2000
17
 
 
18
 
function [y,f] = grep(x)
19
 
y = x(:)(f = find(x));
20
 
## That does not seem to improve anything
21
 
#    if nargout<2,
22
 
#      y = x(find(x));
23
 
#    else
24
 
#      y = x(f = find(x));
25
 
#    end