function h=ImData(X,Y,Z,style) % [h=] ImData(X,Y,Z[,style]) plots image of Z(X,Y) using the style 'flat' (default) % or 'interp' style. X and Y are vectors or 2D arrays, Z is 2D array. % h (optional) can be used for further handling of the image (rotation, etc) % default style if nargin==3; style='flat'; end % squeeze input arrays to 2D % X=squeeze(X); Y=squeeze(X); Z=squeeze(Z); % X and Y matrices % [X,Y]=meshgrid(X,Y); end if size(X,1)==1||size(X,2)==1 if size(X,1)>size(X,2); X=X'; end X=repmat(X,size(Z,1),1); end if size(Y,1)==1||size(Y,2)==1 if size(Y,1)