Can anyone improve my program for generate permutations??

2 ビュー (過去 30 日間)
Triveni
Triveni 2016 年 2 月 20 日
回答済み: Walter Roberson 2016 年 2 月 20 日
a = [20 20 20 20 20 20 10 10 10 10];
a1 = unique(a);
a2 = perms([a1,fliplr(a1), a1]);
p1 = [a2 , fliplr(a2),a2 , fliplr(a2), a2];
p2 = p1 (:, 1:length(a));
ppp = unique(p2,'rows');
threshold = 2;
ppp( sum(ismember(ppp, a1), 2) < threshold, :) = [];
pp = permute(ppp, [3 2 1]);
I want to generate more permutations. Increase variations of theta. i want to make sequence like this...
[20 20 10 10 10 10 10 10 10 10] %only two theta's of 20. means change nos of theta
[ 20 20 20 10 10 10 10 10 10 10]
[10 10 20 20 20 20 20 20 20 20] and so on...unique theta is not less than 2....

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 2 月 20 日

カテゴリ

Help Center および File ExchangeQuantum Computing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by