<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Random number generation in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264846#M717153</link>
    <description>&lt;P&gt;How often does the matrix change?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Dec 2012 05:42:47 GMT</pubDate>
    <dc:creator>altenbach</dc:creator>
    <dc:date>2012-12-26T05:42:47Z</dc:date>
    <item>
      <title>Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264632#M717100</link>
      <description>&lt;P&gt;I have a matrix &amp;nbsp;M of size 5 by 8 and all the elements of this matrix are either one or zero.&lt;/P&gt;
&lt;P&gt;I want to generate a pair of random number, one for row index (between {0,5} ) and other for column index (between {0,8} ) such that the pair generated&lt;/P&gt;
&lt;P&gt;doesn't map to the elements zero of matrix M. The pair should only map to unit elements of M.&lt;/P&gt;
&lt;P&gt;How to do this in labview.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2012 03:30:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264632#M717100</guid>
      <dc:creator>Alice12</dc:creator>
      <dc:date>2012-12-25T03:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264640#M717101</link>
      <description>&lt;P&gt;Use the random number function to generate the row number, and another to generate the column number (multiply by 6 or 9 respectively, and round down to the nearest integer, the floor function.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Determine if the resulting row and column gives you a zero.&amp;nbsp; If it does, repeat until it gives you a one.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2012 04:14:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264640#M717101</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2012-12-25T04:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264658#M717105</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;
&lt;P&gt;That is fine. But if the number of zeros in the matrix is very less, then the program takes very long time to generate appropriate random numbers.&lt;/P&gt;
&lt;P&gt;Is there any solution to this problem ?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2012 05:53:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264658#M717105</guid>
      <dc:creator>Alice12</dc:creator>
      <dc:date>2012-12-25T05:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264668#M717107</link>
      <description>&lt;P&gt;If your matrix is only 6 x 9, that's only 54 possible combinations.&amp;nbsp; A loop will run so quickly, it's going to hit a 1 before you know it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you really trying to do?&amp;nbsp; The question you posed is very odd.&amp;nbsp; It sounds more like a homework assignment rather than a real problem.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2012 06:44:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264668#M717107</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2012-12-25T06:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264690#M717114</link>
      <description>&lt;P&gt;Actually the matrix is of bigger size (about 24 by 36) and the number of unit elements in it is vey few (say 25).&lt;/P&gt;
&lt;P&gt;And I have to generate an appropriate pair of random number in real time.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2012 09:23:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264690#M717114</guid>
      <dc:creator>Alice12</dc:creator>
      <dc:date>2012-12-25T09:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264768#M717134</link>
      <description>&lt;P&gt;Then why'd you say 6 x 9?&amp;nbsp; 24 x 36 is still not very big.&amp;nbsp; Why don't you try programming it with the instructions I said and see how it turns out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean by "real time"?&amp;nbsp; In computers, real time means something very specific.&amp;nbsp; A real time operating system means it is running deterministically and the CPU cycles are guaranteed to run in an alotted time.&amp;nbsp; This can't happen on Windows, Apple, or Linus OS's where the OS can steal CPU cycles to take care of other tasks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2012 18:16:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264768#M717134</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2012-12-25T18:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264838#M717151</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My experiment is a feedback system. I acquire data from a PXI-5124 digitizer and perform some calculation and then send the feedback signal to a second monitor. Finding a pair of random number appropriately is a part of calculation, so I need to do it quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2012 04:53:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264838#M717151</guid>
      <dc:creator>Alice12</dc:creator>
      <dc:date>2012-12-26T04:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264846#M717153</link>
      <description>&lt;P&gt;How often does the matrix change?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2012 05:42:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264846#M717153</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2012-12-26T05:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264852#M717154</link>
      <description>&lt;P&gt;The matrix does't change in one experimental session. It is specific for every experiment.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2012 06:03:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264852#M717154</guid>
      <dc:creator>Alice12</dc:creator>
      <dc:date>2012-12-26T06:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264860#M717157</link>
      <description>&lt;P&gt;How quickly is "quickly"?&amp;nbsp; Would milliseconds be fast enough?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried coding yet to see how quick it can be?&amp;nbsp; This is a simple enough problem.&amp;nbsp; You could have coded it and tested&amp;nbsp;in the time it has taken you to keep reposting!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the matrix doesn't change during the experiment, then you could go through the array at the initialization process and determine which elements have a 1, how many there are, and then sort out the coordinates for each of those 1'.&amp;nbsp; (You are still talking only milliseconds.)&amp;nbsp; Then during the test, do a random number generation to pick out a set of coordinates from your list.&amp;nbsp; (Which is as quick as you can possibly determine a random number.&amp;nbsp; One shot!)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2012 06:44:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264860#M717157</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2012-12-26T06:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264908#M717167</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your suggestion.&lt;/P&gt;
&lt;P&gt;I obtain the matrix from another experiment and need to used it in yet another experiment. For each pair of experiment the matrix is unique.I have&lt;/P&gt;
&lt;P&gt;to perform them several times. Your new suggestion is perfectly fine but I wiill have to do it again and again for each pair of experiment. In fact,&lt;/P&gt;
&lt;P&gt;I have been doing this till now but it is time consuming.&lt;/P&gt;
&lt;P&gt;I coded your first suggestion using a while loop but when used with the actual program (which is driving the experiment), it seems that the program sometimes overrides the "code".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I plan to do post processing of the matrix to implement what I have been doing till now ( your recent suggestion). Any idea how to do it ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2012 11:37:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2264908#M717167</guid>
      <dc:creator>Alice12</dc:creator>
      <dc:date>2012-12-26T11:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Random number generation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2265134#M717214</link>
      <description>&lt;P&gt;Post your code.&amp;nbsp; Everything you've said so far is called basic programming.&amp;nbsp; Having the computer do something over and over again.&amp;nbsp; You say it is time-consuming.&amp;nbsp; How much time does it take?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How does your program "override the code".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Post processing the matrix, how do I do it?"&amp;nbsp; I have no idea.&amp;nbsp; You haven't given any details on what you are trying to do.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2012 18:22:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Random-number-generation/m-p/2265134#M717214</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2012-12-26T18:22:49Z</dc:date>
    </item>
  </channel>
</rss>

