Skip to content
Snippets Groups Projects
Commit 0829faed authored by marwan's avatar marwan
Browse files

lag = zero allowed

parent 3c20ab1e
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,9 @@ function varargout=hist2(varargin)
% $Revision$
%
% $Log$
% Revision 1.9 2004/11/10 07:05:37 marwan
% initial import
%
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
......@@ -55,7 +58,7 @@ splash_gpl('histn');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% read the input
x=varargin{1};
if isempty(varargin{2}) | ~isnumeric(varargin{2}), y=x; lag=1;
if isempty(varargin{2}) | ~isnumeric(varargin{2}), y=x; lag=[];
else, y=double(varargin{2}); end
i_double=find(cellfun('isclass',varargin,'double'));
......@@ -96,6 +99,7 @@ if miny == maxy, miny = miny - floor(nbin/2) - 0.5; maxy = maxy + ceil(nbin/2) -
bins(1,:)=minx:(maxx-minx)/(nbin-1):maxx+eps;
bins(2,:)=miny:(maxy-miny)/(nbin-1):maxy+eps;
if nargout==0
p2 = flipud(p2);
bar3(bins(2,:),p2')
dhy=bins(2,2)-bins(2,1);
set(gca,'xlim',[0 nbin+1-.1],'ylim',[bins(2,1)-dhy bins(2,end)+dhy])
......@@ -109,8 +113,8 @@ if nargout==0
set(gca,'xticklabel',tx)
xlabel('x'), ylabel('y')
elseif nargout==1
varargout{1}=p2;
varargout{1}=fliplr(p2);
elseif nargout==2
varargout{1}=p2;
varargout{1}=fliplr(p2);
varargout{2}=bins';
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment