permutations of vectors in matrix in matlab -
i have static matrix file:
size(data)=[80 5]
what want change position of each vector randomly when use perms like:
n = size(data, 1); x = perms(1:n); % # permutations of column indices y = meshgrid(1:n, 1:factorial(n)); % # row indices idx = (x - 1) * n + y; % # convert linear indexing c = data(idx)
but giving me error: maximum variable size allowed program exceeded.
there other function give me need?
perms
not large numbers i.e number >10
refer documentation
it says
perms(v) practical when length(v) less 10.
see size takes following code:
mb(10,1) = 0; n = 1:10 x = perms(1:n); dt=whos('x'); mb(n)=dt.bytes*9.53674e-7; end plot(1:10,mb,'r*-');
note sudden rise in steepness of curve beyond 9.
Comments
Post a Comment