Sliding window binning and average

10 Ansichten (letzte 30 Tage)
Farshad Daraei Ghadikolaei
Farshad Daraei Ghadikolaei am 20 Apr. 2020
Kommentiert: Mehmed Saad am 21 Apr. 2020
Hi all, I have data in a .csv file with two difderent columns and each column has 245438 row. Please kindly help me to find a MATLAB code to bin the first column with a sliding window of 30 and threshold 1 and make an average of corresponding data in second column for each bin.

Antworten (1)

Mehmed Saad
Mehmed Saad am 20 Apr. 2020
  1. Read data from csv file using readtable, suppose you store it in variable T and the two column of tables are C1 and C2. To access first column use , T.C1 and for 2nd use T.C2
  2. For sliding window, use conv or filter maybe with (ones(1,30))
  3. After filtering, apply threshold by comparing result of step 2 with threshold i.e 1
  6 Kommentare
Farshad Daraei Ghadikolaei
Farshad Daraei Ghadikolaei am 20 Apr. 2020
Thanks Muhammad for your contribution. I have developed the answer of Thiago Henrique Gomes: (https://au.mathworks.com/matlabcentral/answers/492847-how-to-create-a-sliding-window-function-over-column-vector-m) to reach what code related to my question.
Mehmed Saad
Mehmed Saad am 21 Apr. 2020
Great

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Performance and Memory finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by