function [bs,es,levs] = clines(c)

% [bs,es,levs] = clines(c); 
% 
% This function takes output from the contour program {c=contour()} and
% returns the beginning and ending indices for each line and its
% associated contour level.  To plot any single contour line: 
% plot( c(1,bs(l):es(l)), c(2,bs(l):es(l)) ), where l is any integer from
% 1:length(bs);

% dail, april 1998

l=1;
m=1;
while l < max(size(c))
 levs(m) = c(1,l);
 bs(m) = l+1;
 es(m) = l+c(2,l);
 l = es(m)+1;
 m = m+1;
end
