How to subset rows with reproducibility?

1 回表示 (過去 30 日間)
Chris H
Chris H 2018 年 2 月 20 日
回答済み: Star Strider 2018 年 2 月 20 日
If I have a 10 by 5 matrix, how would I subset the data so that the same rows are selected each time?
I know how to select 10 random rows, but I'm unsure how to make it reproducible.

採用された回答

Star Strider
Star Strider 2018 年 2 月 20 日
If you’re using a random number generator to select the rows, see the documentation for the rng (link) function. Otherwise, just select them yourself, for example [3 9 5 2 7], or whatever combination you want.

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by