フィルターのクリア

100 permutation

1 回表示 (過去 30 日間)
Niki
Niki 2011 年 11 月 9 日
I have the following matrix
x =
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
I would like to have 100 different permutation and in each I change randomly one variable of each row with others like this
1 7 13 4 5
then
11 5 4 19 2
and so on
  15 件のコメント
Image Analyst
Image Analyst 2011 年 11 月 9 日
It's getting clearer. The above seems clear but I'm not sure where [11 5 4 19 2] comes from in your first post. That is not in your list just now.
Sven
Sven 2011 年 11 月 10 日
Mohommad, have I answered your question on the original thread?
http://www.mathworks.com/matlabcentral/answers/20551-combination
Just set solutionLimit = 100, and it seems to solve this exact same question.

サインインしてコメントする。

回答 (1 件)

Dr. Seis
Dr. Seis 2011 年 11 月 9 日
Stab in the dark:
sizeX = [4,5];
permlimit = 100;
X = reshape(1:prod(sizeX),fliplr(sizeX))';
Y = zeros([permlimit, sizeX(2)]);
for ii = 1 : permlimit
for jj = 1 : sizeX(2)
Y(ii,jj) = X(randi(sizeX(1)),jj);
end
end
disp(Y)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by