Grep.m

From Pnb
Revision as of 12:43, 17 March 2011 by Eriks (talk | contribs) (Created page with '<pre> function [A,I]=grep(strarray,str) %strarray is char array A=[]; I=[]; for irow=1:size(strarray,1), if findstr(deblank(strarray(irow,:)),str), I=[I ; irow]…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
function [A,I]=grep(strarray,str)
  %strarray is char array
  A=[];
  I=[];
  for irow=1:size(strarray,1),
    if findstr(deblank(strarray(irow,:)),str),
      I=[I ; irow];
      A=strvcat(A,strarray(irow,:));
    end
  end
  

grep