permutation matrix for process simulation
이전 댓글 표시
Hello,
I'd like to test the combined effect of different filtration unit (diafiltration, ultrafiltration,...) and used them in different order. For now I have a manual code that works with a small number of unit filtration, but I would like to find something more generic and that would work with a N filtration units. For that, I need a matrix that contains the different possibilities.
The idea is to test firstly all the filtration units separately and then combine them gradualy while permuting the order.
Separator 1
Separator 2
...
Separator 1 / Separator 2
Separator 2 / Separator 1
Separator 1 / Separator 3
...
Separator 1 / Separator 2 / Separator 3
...
a=1; %Separator1
b=2; %Separator2
c=3; %Separator3
d=4; %Separator4
a1=[perms(a),0,0,0];
a2=[perms(b),0,0,0];
a3=[perms(c),0,0,0];
a4=[perms(d),0,0,0];
a5=[perms([a,b]),zeros(2,2)];
a6=[perms([a,c]),zeros(2,2)];
a7=[perms([a,d]),zeros(2,2)];
a8=[perms([b,c]),zeros(2,2)];
a9=[perms([b,d]),zeros(2,2)];
a10=[perms([c,d]),zeros(2,2)];
a11=[perms([a,b,c]),zeros(6,1)];
a12=[perms([a,b,d]),zeros(6,1)];
a13=[perms([b,c,d]),zeros(6,1)];
a14=perms([a,b,c,d]);
A=[a1;a2;a3;a4;a5;a6;a7;a8;a9;a10;a11;a12;a13;a14];
the results I need is that:
A=
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
2 1 0 0
1 2 0 0
3 1 0 0
1 3 0 0
4 1 0 0
1 4 0 0
3 2 0 0
...
thanks by advance,
bruno
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Elementary Math에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!