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 comentarios

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

Iniciar sesión para comentar.

Respuestas (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'

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Dic. de 2019

Respondida:

el 30 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by