How could i write matlab code for Sequencing of machining operation using for loop?

How could i get these 16 possibl combinations using matlab code?

2 Comments

You should put more context to this question. It is hard to understand what you are trying to do from the question
By combinaton sequence nchoosek code I want to sort out these 16 combinations for example 11 12 21 22 31 31....Repition is not allowed

Sign in to comment.

Answers (1)

I have reached this label, do apply more logic and get the exact result, it can be possible, but here code is little non efficient. If you manage any efficient way, it would be recomended.
count=1;j=1;
for i=1:6
while count<=8
data{count,i}=['Seq',num2str(i),num2str(j)];
count=count+1;
end
while count<=16
data{count,i}=['Seq',num2str(i),num2str(j+1)];
count=count+1;
end
count=1;
end
data
Result:
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq11' 'Seq21' 'Seq31' 'Seq41' 'Seq51' 'Seq61'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'
'Seq12' 'Seq22' 'Seq32' 'Seq42' 'Seq52' 'Seq62'

Categories

Asked:

on 28 Dec 2019

Answered:

on 30 Dec 2019

Community Treasure Hunt

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

Start Hunting!