i have a vector which contain 23 elements.i wanna choose 20 elements among this 23 elements randomly.how can i do this?

1 次查看(过去 30 天)
i have a vector which contain 23 elements.i wanna choose 20 elements among this 23 elements randomly.how can i do this?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-4-19
编辑:Azzi Abdelmalek 2016-4-19
A=randi(50,1,23)
out = A(randperm(23,20))
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Standard File Formats 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by