Hourly averaging by removing negative values
Show older comments
I have excel file containing time series data of some 76500 data points in each column. I want to remove the rows containing negative values (In example : AB3 to EF3 & AB4 to EF4) and after removing negative values i want to do the hourly averaging of such data and also want . Kindly help me with the script as I am using it for the first time.
For example: The dataset looks like this
Date Time AB BC CD DE EF
01/05/2021 0:01:00 4.84 8.32 5.67 8.53 2.77
01/05/2021 0:01:02 2.55 9.22 3.47 7.35 3.07
01/05/2021 0:01:03 3.58 -7.33 4.31 8.30 2.44
01/05/2021 0:01:04 5.38 4.53 -8.31 8.90 7.41
.
.
01/05/2021 23:59:59 4.84 8.32 5.67 8.53 2.77
2 Comments
Scott MacKenzie
on 2 May 2021
I read and re-read your question and just can't figure out what you are asking. I see two negative values in the example data, but don't see the connection to "(In example : AB3 to EF3 & AB4 to EF4)". And what do you mean by "such data". Please clarify.
Image Analyst
on 2 May 2021
You forgot to attach the workbook. Please do so. In the meantime, you can remove the row if there is a negative number in it.
rowsToRemove = any(data < 0, 2); % Identify rows with negative values.
data = data(~rowsToRemove, :); % Extract good (non-negative) rows only.
To get 24 hourly averages, I'd need the data to play around with it a little bit.
Answers (0)
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!