% -*- texinfo -*- % @deftypefn {Function File} {[@var{err}, @var{y1}, @dots{}] =} common_size (@var{x1}, @dots{}) % Determine if all input arguments are either scalar or of common % size. If so, @var{err} is zero, and @var{yi} is a matrix of the % common size with all entries equal to @var{xi} if this is a scalar or % @var{xi} otherwise. If the inputs cannot be brought to a common size, % errorcode is 1, and @var{yi} is @var{xi}. For example, % % @example % @group % [errorcode, a, b] = common_size ([1 2; 3 4], 5) % @result{} errorcode = 0 % @result{} a = [ 1, 2; 3, 4 ] % @result{} b = [ 5, 5; 5, 5 ] % @end group % @end example % % @noindent % This is useful for implementing functions where arguments can either % be scalars or of common size. % @end deftypefn