function A = findcoords(C, ident) %FINDCOORDS Returns rows of Coords that begin with the values in vector IDENT. % % % NEWCOORDS = FINDCOORDS(COORDS, IDENT) % % Claudio Oct. 16 1995 % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % A=[]; if nargin <2 error('Too few input arguments'); end if nargin>2 error('Too many input arguments'); end if isempty(C) return; end for i=1:length(ident) index = [index; find(C(2:size(C,1),1) == ident(i))]; end if ~isempty(index) index=[index;find(isnan(C(2:size(C,1),1))==1)]; sort(index+1); A=C(sort(index+1),:); top=zeros(1,size(A,2)); top(1)=length(find(isnan(A(:,1))==1)); A=[top;A]; end return