Random sample, I want the 5% of the data per each hour
古いコメントを表示
I have a database with 19 columns. One column has date, month, year and hour. I would like to get, per each hour, the 5% of the data. Naturaly, I would like to see all the other data, along with the column of time.
Can you help me?
I saw the comand resample, but at the moment, I am in difficulty.
2 件のコメント
Scott MacKenzie
2021 年 6 月 4 日
It would help if you post the data -- or, better yet, a subset of the data -- and any code you have written so far.
Rachele Franceschini
2021 年 6 月 4 日
採用された回答
その他の回答 (1 件)
KSSV
2021 年 6 月 4 日
Let A be your data matrix.
[m,n] =size(A) ;
p = round(5/100*m) ;
idx = randsample(m,n) ;
iwant = A(idx,:)
カテゴリ
ヘルプ センター および File Exchange で Time Series Events についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!