How to pick data from time range of every day?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Marek Hamza
el 4 de En. de 2020
Respondida: Vinod
el 5 de En. de 2020
Hello!
How do I pick up a data in the specific time period through all the days back?
This is my code so far...
% set time range from 8H to 12H of every day
S = timerange('08:00:00','12:00:00');
% Read Temperature Data
data = thingSpeakRead(readChannelID,'Fields',TemperatureFieldID, ...
'timerange',S, 'ReadKey',readAPIKey);
% Calculate the maximum and minimum temperatures in the period
[maxTempF] = max(data);
[minTempF] = min(data);
I would be so happy for any ideas :)
0 comentarios
Respuesta aceptada
Vinod
el 5 de En. de 2020
Here's an example:
d = thingSpeakRead(12397,'NumPoints',8000,'OutputFormat','TimeTable');
t = timerange(today('datetime'),today('datetime')+hours(3));
first3Hr = d(t,:)
Feel free to modify as needed. Also take a look at the documentation for thingSpeakRead, timerange and date/time arithmetic in MATLAB.
0 comentarios
Más respuestas (0)
Comunidades de usuarios
Más respuestas en ThingSpeak Community
Ver también
Categorías
Más información sobre Read Data from Channel en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!