필터 지우기
필터 지우기

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
Donne
Donne 2022년 12월 5일
Thank you. it works
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