~ubuntu-branches/ubuntu/trusty/octave-miscellaneous/trusty

« back to all changes in this revision

Viewing changes to inst/inz.m

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Weber
  • Date: 2011-05-12 20:57:43 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110512205743-ej2yjlpcbtbrwdjo
Tags: 1.0.11-1
* New upstream release (Closes: #626264)
* debian/control:
  - Remove Rafael Laboissiere from Uploaders (Closes: #571851)
  - Remove Ólafur Jens Sigurðsson <ojsbug@gmail.com> from Uploaders 
* Bump Standards-Version to 3.9.1, no changes needed
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

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