samer@47: function c=bipolarjoin(a,b) samer@47: % BIPOLARJOIN - Create bipolar colormap ('black' in the middle) by joining two maps samer@47: % samer@47: % map=bipolarjoin(neg,pos) - return colourmap [flipud(neg); pos] samer@47: % ie colormap neg is reversed. If no output argument specified, colormap is samer@47: % installed in current figure. samer@47: if size(a,1)~=size(b,1), error('Colormaps must be of same length'); end samer@47: samer@47: out=[flipud(a); b]; samer@47: if nargout<1, colormap(out); else c=out; end;