Picking random values from an array.

2 次查看(过去 30 天)
Donne
Donne 2022-12-5
评论: Rik 2022-12-5
I extracted some data for a work using MATLAB and plot these values, but because the number of values in the array were many, my model had lots of noise in it. So i would to know how I could select just a few points which are spread along the plot from the start through to the end.

回答(1 个)

Rik
Rik 2022-12-5
k=round(numel(Data)/100);
Data(sort(randperm(end,k))
This will give you a random sample of your vector.
  2 个评论
Rik
Rik 2022-12-5
You're welcome.
If this solved the problem, please consider marking it as accepted answer.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by