| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
reset(s)
reset(s,seed)
reset(s) resets the generator for the random stream s to its initial internal state. This is similar to clearing s and recreating it using RandStream('type',...), except reset does not set the stream's RandnAlg, Antithetic, and FullPrecision properties to their original values.
reset(s,seed) resets the generator for the random stream s to the initial internal state corresponding to the seed seed. Resetting a stream's seed can invalidate independence with other streams.
Create a random stream object.
s=RandStream('mt19937ar')Make it the default stream.
RandStream.setDefaultStream(s)
Reset the stream object you just created and generate 5 uniform random values using the rand method.
rand(s,1,5)
ans =
0.3631 0.4048 0.1490 0.9438 0.1247
Reset the stream.
reset(s)
Generate the same 5 random values from the default stream.
rand(s,1,5)
ans =
0.3631 0.4048 0.1490 0.9438 0.1247![]() | reset | reshape | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |