Extracting specific data from time range excel
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Y.y
am 4 Mär. 2023
Kommentiert: Star Strider
am 4 Mär. 2023
I have exported data from a sensor reading. It doesn't allow me to extract hourly data and that's what I really need. In the excel table, I have the device name, date and time (10 mins interval), the readings. I would like to know a faster way to filter out 1 data reading per hour (data is provided every 10 mins interval).
0 Kommentare
Akzeptierte Antwort
Star Strider
am 4 Mär. 2023
It would help to have the Excel file.
The ‘1 data raeading per hour’ request is open to intpretation.
Then, depending on what you want to do, you can either take a specific interval in every hour, or aggregate the data over every hour.
T1 = table(datetime(2023,03,01)+minutes(0:10:300).', randn(31,1), 'VariableNames',{'Timestamp','Sensor'})
EveryHour = T1(minute(T1{:,1})==0,:) % First Entry Every Hour
HourlyMean = table2timetable(T1);
HourlyMean = retime(HourlyMean, 'hourly','mean') % Mean Of Every Hour
A bit of clarification of what you want to do would help.
.
2 Kommentare
Star Strider
am 4 Mär. 2023
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1314110/Data%20Sample.csv')
% TT1 = table2timetable(movevars(T1,4,'Before',1))
EveryHour = T1(minute(T1{:,4})==0,:)
No exact data exist for some time values, such as ‘00:00’ and ‘01:00’. They could be forced to exist using the approach in Interpolate Timetable Data to Time Vector, however that can create data where none previously existed, so I do not usuallly recommend it.
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!