generate a combination

6 vues (au cours des 30 derniers jours)
FIR
FIR le 31 Oct 2011
there are 4026 datas i want to take 2data from top 100 to genarate FCI,can u tell how to process please
  2 commentaires
the cyclist
the cyclist le 31 Oct 2011
Please edit your question to provide much more detail about what you want. It is not possible to understand what you mean. For example:
How are your 4026 data stored?
What do you mean by "top 100"?
How do you want to choose the 2 data from the 100? Should it be random?
Etc.
Remember we know NOTHING about your problem except what you tell us here.
FIR
FIR le 31 Oct 2011
data are stored as
data=[1,2,3........4026]
top 100 means 1st 100,2nd 100,3rd100..so tere are (41 100's)
1&2 from 1st100
101*102 from 2nd 100
201&202 from 3rd 100
'
'
'
'
'3901*3902
4001&4002 from last hundred

Connectez-vous pour commenter.

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 31 Oct 2011
data = 1:4026;
out = sort(data([1:100:end,2:100:end]));
or
out = data([1:100:end;2:100:end])'
or
out = bsxfun(@plus,sort([randi(100,floor(4026/100),2);randi(26,1,2)],2),(0:100:4000)');
  2 commentaires
Daniel Shub
Daniel Shub le 31 Oct 2011
That is a different interpretation to mine. I wonder if either of us are even close.
FIR
FIR le 31 Oct 2011
thanks a lot andrei...how to generate FCI COMBINATION FROM THIS

Connectez-vous pour commenter.

Plus de réponses (1)

Daniel Shub
Daniel Shub le 31 Oct 2011
You are still not giving us much to go on ...
randi(100, 2, 1)
will give you two random number between 1 and 100.
doc randi
will tell you how the randi function works.

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by