Generate 100 data randomly, or select if it is possible

后端 未结 1 719
一生所求
一生所求 2021-01-27 10:59

I want to test my model , I need to test it in some data , I want to generate data , in fact I want to have 125 different parameter from 0 to 10000.

For example , in be

1条回答
  •  隐瞒了意图╮
    2021-01-27 11:36

    Try this:

    Set       I     /0*300/
              picks /p1*p4/;
    Scalar    pick;
    Parameter MyParameter(I);
    
    MyParameter(I) = 0;
    loop(picks,
      pick = uniformInt(1, card(I));
    
    * Make sure to not pick the same one twice
      while(sum(I$(pick=ord(I)),MyParameter(I))=1,
        pick = uniformInt(1, card(I))
        Display 'here';
      );
    
      MyParameter(I)$(pick=ord(I))=1;
    );
    Display MyParameter;
    

    0 讨论(0)
提交回复
热议问题