How to read the rainfall data format attached in the file and obtain the monthly, annual daily and hourly maximum values? Kindly help me with this
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
MEGHANA N
el 23 de Abr. de 2021
Respondida: MEGHANA N
el 23 de Abr. de 2021
I need to read the data and obtain the monthly, annual, daily and hourly maximum values.
I used readtable to import the data. Have difficulty reading the time format.
0 comentarios
Respuesta aceptada
Cris LaPierre
el 23 de Abr. de 2021
Editada: Cris LaPierre
el 23 de Abr. de 2021
Once you get the data to import correctly (see datetime for time formatting options), I think you want to use groupsummary. Use the following syntax
% Set up import settings
opts = detectImportOptions("rainfall_data.xlsx");
opts = setvartype(opts,"Var1","datetime");
opts = setvaropts(opts,"Var1",'InputFormat','yyyyMMdd HH:mm');
% import data
data = readtable('rainfall_data.xlsx',opts)
% Determine max rainfal by year
yrMaxRain = groupsummary(data,"Var1","year","max")
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!