How to put different seed in a multidimensional matrix
2 views (last 30 days)
More Answers (2)
Chunru on 13 Jul 2022
Not sure why you have to do this. But it can be done as follows:
n = 10; k=3;
X = zeros([n,k,n]);
seeds = [1:n]; % your seed numbers
X(:, :, i) = rand(n, k);
Steven Lord on 13 Jul 2022
You might think that by changing the seed so frequently you're making the numbers "more random". You're not, as stated by the Note on this documentation page.
Call rng once before you start generating random numbers. Generate your numbers. Then if you need a different seed for your next run call rng again with a different seed.