07-08-2011 11:23 AM
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.
Solved! Go to Solution.
07-08-2011 11:26 AM
You need to compare the previous output with the new one; and skip it when the output is the same.
07-08-2011 11:56 AM
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
07-08-2011 12:12 PM - edited 07-08-2011 12:14 PM
Yep better ways to do this
If I understand correctly (from your code) you want to shuffle the lines randomly See below
For improved randomness you ca generate a random seed to input to Riffle.vi
07-08-2011 12:15 PM
07-08-2011 12:24 PM
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
07-08-2011 12:32 PM - edited 07-08-2011 12:33 PM
07-08-2011 12:35 PM - edited 07-08-2011 12:38 PM
... now if only riffle would also accept an array of strings directly ... 😉
... in the meantime, try this. 😄
07-08-2011 12:43 PM - edited 07-08-2011 12:44 PM
If you only have LabVIEW base (no riffle!), you could do as follows (taking advantage that clusters are sorted in element order):
07-08-2011 12:54 PM
I'm thinking Randomize 1D Array will suffice Thanks for point it out- (guess what just hit my reuse library?)