- Dates and Time - https://in.mathworks.com/help/matlab/date-and-time-operations.html
- datetime - https://in.mathworks.com/help/matlab/ref/datetime.html
- timetable - https://in.mathworks.com/help/matlab/ref/timetable.html
- retime - https://in.mathworks.com/help/matlab/ref/timetable.retime.html
- standardizeMissing - https://in.mathworks.com/help/matlab/ref/standardizemissing.html
- rmmissing - https://in.mathworks.com/help/matlab/ref/rmmissing.html
I have timestamp_start and end data with other variables at the interval of 30 min yearly data. How can I sum/ avg daily/monthly/yearly avoiding -9999/Nan ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
201901010000 201901010030 -9999 -9999 -9999 -9999 -9999
201901010030 201901010100 -9999 -9999 -9999 -9999 -9999
201901010100 201901010130 -9999 -9999 -9999 -9999 -9999
201901010130 201901010200 -9999 -9999 -9999 -9999 -9999
201901010200 201901010230 -9999 -9999 -9999 -9999 -9999
201901010230 201901010300 -9999 -9999 -9999 -9999 -9999
201901010300 201901010330 -9999 -9999 -9999 -9999 -9999
201901010330 201901010400 -9999 -9999 -9999 -9999 -9999
201901010400 201901010430 -9999 -9999 -9999 -9999 -9999
201901010430 201901010500 -9999 -9999 -9999 -9999 -9999
201901010500 201901010530 -9999 -9999 -9999 -9999 -9999
201901010530 201901010600 -9999 -9999 -9999 -9999 -9999
201901010600 201901010630 -9999 -9999 -9999 -9999 -9999
201901010630 201901010700 -9999 -9999 -9999 -9999 -9999
201901010700 201901010730 -9999 -9999 -9999 -9999 -9999
201901010730 201901010800 -9999 -9999 -9999 -9999 -9999
201901010800 201901010830 -9999 -9999 -9999 -9999 -9999
201901010830 201901010900 -9999 -9999 -9999 -9999 -9999
201901010900 201901010930 -9999 -9999 -9999 -9999 -9999
201901010930 201901011000 -9999 -9999 -9999 -9999 -9999
201901011000 201901011030 215 9.1 2427.7 -9999 -10.6
201901011030 201901011100 130 9.6 2314.4 1.85 -11.3
201901011100 201901011130 165 9.0 2231.5 0.6 -32.6
201901011130 201901011200 421 7.7 2261.6 1.2 -12.6
201901011200 201901011230 421 7.5 2279.4 1.7 2.3
201901011230 201901011300 201 7.1 2258.2 4.1 2.1
201901011300 201901011330 105 6.9 2255.8 4.4 27.0
201901011330 201901011400 519 6.9 2259.5 3.9 10.1
0 Commenti
Risposte (1)
Seth Furman
il 12 Set 2022
Modificato: Seth Furman
il 12 Set 2022
Take a look at the following:
data = [
201901010000 201901010030 -9999 -9999 -9999 -9999 -9999
201901010030 201901010100 -9999 -9999 -9999 -9999 -9999
201901010100 201901010130 -9999 -9999 -9999 -9999 -9999
201901010130 201901010200 -9999 -9999 -9999 -9999 -9999
201901010200 201901010230 -9999 -9999 -9999 -9999 -9999
201901010230 201901010300 -9999 -9999 -9999 -9999 -9999
201901010300 201901010330 -9999 -9999 -9999 -9999 -9999
201901010330 201901010400 -9999 -9999 -9999 -9999 -9999
201901010400 201901010430 -9999 -9999 -9999 -9999 -9999
201901010430 201901010500 -9999 -9999 -9999 -9999 -9999
201901010500 201901010530 -9999 -9999 -9999 -9999 -9999
201901010530 201901010600 -9999 -9999 -9999 -9999 -9999
201901010600 201901010630 -9999 -9999 -9999 -9999 -9999
201901010630 201901010700 -9999 -9999 -9999 -9999 -9999
201901010700 201901010730 -9999 -9999 -9999 -9999 -9999
201901010730 201901010800 -9999 -9999 -9999 -9999 -9999
201901010800 201901010830 -9999 -9999 -9999 -9999 -9999
201901010830 201901010900 -9999 -9999 -9999 -9999 -9999
201901010900 201901010930 -9999 -9999 -9999 -9999 -9999
201901010930 201901011000 -9999 -9999 -9999 -9999 -9999
201901011000 201901011030 215 9.1 2427.7 -9999 -10.6
201901011030 201901011100 130 9.6 2314.4 1.85 -11.3
201901011100 201901011130 165 9.0 2231.5 0.6 -32.6
201901011130 201901011200 421 7.7 2261.6 1.2 -12.6
201901011200 201901011230 421 7.5 2279.4 1.7 2.3
201901011230 201901011300 201 7.1 2258.2 4.1 2.1
201901011300 201901011330 105 6.9 2255.8 4.4 27.0
201901011330 201901011400 519 6.9 2259.5 3.9 10.1
];
t = array2table(data);
t.Properties.VariableNames(1:2) = ["Start","End"]
t.Start = datetime(string(t.Start),InputFormat="yyyyMMddHHmm")
t.End = datetime(string(t.End),InputFormat="yyyyMMddHHmm")
t = standardizeMissing(t,-9999,"DataVariables",t.Properties.VariableNames(3:end))
tNoMissing = rmmissing(t,"DataVariables",t.Properties.VariableNames(3:end));
tNoMissing = table2timetable(tNoMissing)
retime(tNoMissing(:,3:end),"daily","mean")
retime(tNoMissing(:,3:end),"monthly","sum")
retime(tNoMissing(:,3:end),"yearly","mean")
0 Commenti
Vedere anche
Categorie
Scopri di più su Calendar in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!