function A=rowcopy(v,n)
% Create a matrix with each of n rows equal to vector or scalar v
% function rowcopy, written 2/28/94,modified: 3/25/94
% format: function A=rowcopy(v,n)
% v: a row vector or scalar
% n: a scalar with the number of rows to copy.
% by E Gallagher, UMASS/Boston, written: 2/28/94
% Email: Eugene.Gallagher@umb.edu
% Based on a tip in the matlab user's notes, a 1-line m.file
%   A=v(ones(n,1),:);
[r,c]=size(v);
if min([r c])~=1
   error('v must be a vector')
elseif r>c
   v=v';
end
A=v(ones(n,1),:);