[Index for tmp_for_tar/struct]
[Return to Master Index]
grep
(tmp_for_tar/struct/grep.m)
Function Synopsis
[y,f] = grep(x)
Help text
y = grep(x) == x(find(x))
[y,f] = == [x(find(x)),find(x)]
This function is just to save typing and improve readability, as in
foo(find(foo(:,p)),p) vs. grep(foo(:,p))
Last modified: October 2000
Cross-Reference Information
This function is called by
- tar tmp_for_tar/struct/tar.m
Listing of function file tmp_for_tar/struct/grep.m
## y = grep(x) == x(find(x))
## [y,f] = == [x(find(x)),find(x)]
##
## This function is just to save typing and improve readability, as in
##
## foo(find(foo(:,p)),p) vs. grep(foo(:,p))
## Author: Etienne Grossmann <etienne@isr.ist.utl.pt>
## Last modified: October 2000
function [y,f] = grep(x)
y = x(:)(f = find(x));
## That does not seem to improve anything
# if nargout<2,
# y = x(find(x));
# else
# y = x(f = find(x));
# end
Produced by oct2html on Wed Aug 8 19:47:02 2001
Cross-Directory links are: ON