function randcell = randomization(x,n) % This function will perform a randomization of a 3-dimensional cell for one % iteration. If more iterations are desired, call this function in a do % loop. % % DESCRIPTION: % Perform a randomization of cell x a total of t iterations. % % INPUT VARIABLES: % x - This should be a cell parameter containing matrices of equal size. % n - number of random permutations desired, usually the size of the % dataset in question. % % OUTPUT VARIABLES: % randcell - This is the resultant randomized x % % By: Stephen W. Bieda, III % Coded on: 09/14/2007 % E-mail: bieda@atmo.arizona.edu a = randperm(n); b = size(x); randcell = cell(size(x)); for i = 1:n; for j = 1:b(1); for k = 1:b(2); for l = 1:n; switch a(i); case l randcell{j,k}(i) = x{j,k}(l); end end end end end return