<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'confirm rand' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'confirm rand' posted on the 'Matlab' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 14:13:32 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 14:13:32 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>confirm rand</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/410606/410606/confirm-rand/</link>
      <description>Hi, &lt;br /&gt;
I am using Matlab version 6.1. &lt;br /&gt;
I am using the Rand function to generate random numbers but would like to clarify a number of things.&lt;br /&gt;
Is RAND based on the CPU Clock cycle? &lt;br /&gt;
Also, if I use &lt;br /&gt;
rand('seed',fix(100*(sum(clock)))); &lt;br /&gt;
does this ensure my seed is changed every time? &lt;br /&gt;
&lt;br /&gt;
Thanks</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/410606/410606/confirm-rand/</guid>
      <pubDate>Fri, 11 Dec 2009 04:44:09 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Re: confirm rand</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/410606/410682/re-confirm-rand/#410682</link>
      <description>I guess yes, the random numbers have something to do with the internal clock.&lt;br /&gt;
&lt;br /&gt;
Besides, this is taken from the on-line help for version 7.0.1&lt;br /&gt;
(sorry, I don't have your version)&lt;br /&gt;
&lt;br /&gt;
Return RAND to its default initial state.&lt;br /&gt;
rand('state',0)&lt;br /&gt;
 &lt;br /&gt;
Initialize RAND to a different state each time.&lt;br /&gt;
rand('state',sum(100*clock))&lt;br /&gt;
 &lt;br /&gt;
Save the current state, generate 100 values, reset the state,&lt;br /&gt;
and repeat the sequence.&lt;br /&gt;
s = rand('state');&lt;br /&gt;
u1 = rand(100);&lt;br /&gt;
rand('state',s);&lt;br /&gt;
u2 = rand(100); % contains exactly the same values as u1&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Learn Matlab by-example!&lt;br /&gt;
&lt;a href="http://www.matrixlab-examples.com"&gt;http://www.matrixlab-examples.com&lt;/a&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/410606/410682/re-confirm-rand/#410682</guid>
      <pubDate>Sat, 12 Dec 2009 16:12:15 -0700</pubDate>
      <category>Matlab</category>
    </item>
  </channel>
</rss>
