function [cont,J]=levels(c) % LEVELS the contourlevels from the contourmatrix c % % cont = levels(c) % % c = contourmatrix as described in CONTOURC % % cont = vector of contourlevels (like the one you give into CONTOUR % when you want manual control of the contourlevels). % % BEWARE: In the contourmatrix from CONTOURF there may occur a "fictive" % contourlevel, nemely min(min(data)), even when giving explicit input of % desired levels. This is just a warning, LEVELS does not counteract this. % % See also CONTOURC ECOLORBAR %Time-stamp: %File: error(nargchk(1,1,nargin)); cont=[]; i=1;j=0; while i <= size(c,2) j=j+1; cont(j)=c(1,i); pairs=c(2,i); i=i+pairs+1; J(j)=i; % if j==1 | cont(j)~=cont(j-1) % end end %cont=cont(1:end-1); [cont,J]=unique(cont); % remove repetitions from "islands" J=J';