キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Generate Random numbers

解決済み
解決策を見る

Hello All,

 

I have searched the forum and have realised, there are lot of random number generation ideas, however i have a different question, best explained by the attachment.

 

I want to have unique outputs.

your inputs are appreciated.

すべてをダウンロード
0 件の賞賛
メッセージ1/13
5,925件の閲覧回数

You need to compare the previous output with the new one; and skip it when the output is the same.

0 件の賞賛
メッセージ2/13
5,922件の閲覧回数

Instead of focussing on changing the output.. i would like to change the random input in such a way that it always picks a unique line.

My output in my program will be hundreds of line, and so i would not like to mess around.

 

Please let me know, if you need any more inputs

Thanks

0 件の賞賛
メッセージ3/13
5,910件の閲覧回数

Yep better ways to do this

 

If I understand correctly (from your code) you want to shuffle the lines randomly See below

untitled.PNG

 

For improved randomness you ca generate a random seed to input to Riffle.vi


"Should be" isn't "Is" -Jay
0 件の賞賛
メッセージ4/13
5,899件の閲覧回数
解決策
トピック作成者Rambo333が受理

I haven't seen your code because i'm using LV2009 but I think the attached vi will do want you want.

 

Ben64

0 件の賞賛
メッセージ5/13
5,894件の閲覧回数

I wanted to do something with the shift registers and converting my string to an array.... but my program was not very convenient to do so...

Thanks !!!

It works like a charm...

 

@ Jeff..

 

I will implement your style and see the results.

 

Thank you

0 件の賞賛
メッセージ6/13
5,882件の閲覧回数

I agree with Jeff that riffle is a cleaner solution:

 

 

すべてをダウンロード
0 件の賞賛
メッセージ7/13
5,876件の閲覧回数
メッセージ8/13
5,869件の閲覧回数

If you only have LabVIEW base (no riffle!), you could do as follows (taking advantage that clusters are sorted in element order):

 

 

すべてをダウンロード
0 件の賞賛
メッセージ9/13
5,854件の閲覧回数

I'm thinking Randomize 1D Array will sufficeスマイリー とてもハッピー  Thanks for point it out- (guess what just hit my reuse library?)


"Should be" isn't "Is" -Jay
0 件の賞賛
メッセージ10/13
5,843件の閲覧回数