function [m2,n2] = size3d(m,n,p)
%SIZE3D	Size of 2-D matrix to hold 3-D matrix.
%	SIZE3D(M,N,P) returns the size of the 2-D matrix that holds
%	the 3-D M-by-N-by-P matrix.  
%
%	[M2,N2] = SIZE3D(M,N,P) returns the 2-D size as row and column
%	dimensions M2 and N2.
%
%	[...] = SIZE3D([M N P]) also works.

%	Clay M. Thompson 11-5-92
%	Copyright (c) 1992 by The MathWorks, Inc.
%	$Revision: 1.5 $  $Date: 1993/09/03 14:28:13 $

if nargin==1,
  if any(size(m)~=[1 3]), 
    error('A single argument must be a 1-by-3 size vector.');
  end
  m2 = m(1)*m(2);
  n2 = m(3);
else
  m2 = m*n;
  n2 = p;
end

if nargout<=1,
  m2 = [m2 n2];
end
