function B = shuffle(A)
% SHUFFLE shuffles the rows of matrix A randomly. 
%	B = shuffle(A) shuffles rows of A, result is stored in B
%

% determine number of rows in A
m = size(A,1);
%
% copy A into B
B = A;
%
% shuffle
for count = 1:m
	switch = randint(1,1,1,m);
	temp = B(count,:);
	B(count,:) = B(switch,:);
	B(switch,:) = temp;
end
