MATLAB: How to fix the seed in the trnd function

trnd

Dear all,
I use matlab 2012 and I want to generate values from a student t distribution. I use the function "trnd". HOw can I fix the see in this function
thanks

Best Answer

I'm not sure why you want to do that since you can use rng() without using the legacy mode by removing those calls and using rng() instead.
But if you are insisting, then you have to do something like:
rng(sd,'v5uniform')
for calls to rand()
and
rng(sd,'v5normal')
for randn(), where sd is the seed.
You should enter
>>help rng
at the command line and read the documentation linked from
Updating Your Random Number Generator Syntax.
This is all explained there in detail.