How to extract rows by date?
Mostrar comentarios más antiguos
say I have a table A
18-Dec-2015 42.3000 29.9000 7.3000
18-Dec-2015 37.3000 30.1000 13.4000
18-Dec-2015 39.1000 30.0300 6.5000
18-Dec-2015 42.3000 29.9000 7.3000
19-Dec-2015 37.3000 30.1000 13.4000
19-Dec-2015 39.1000 30.0300 6.5000
20-Dec-2015 42.3000 29.9000 7.3000
20-Dec-2015 39.1000 30.0300 6.5000
20-Dec-2015 37.3000 30.1000 13.4000
I have almost 3000 days to do. How could I use a loop to extract rows by time and do some calculation separately? Thanks in advance!!! I tried ismember and the following one but neither works.
for i = (:,1)
if A(i,1)=A(i+1,1)
C=A(i,:)
...
2 comentarios
Jan
el 12 de Mayo de 2018
It would be useful to post some code, which creates the example data or to attach the variable as MAT file. This would clarify, which format the "table" has exactly.
What is the purpose of "for i = (:,1)"? "Neither works" is less useful than posting the error message.
Iris Li
el 12 de Mayo de 2018
Respuesta aceptada
Más respuestas (1)
Star Strider
el 12 de Mayo de 2018
1 voto
I have no idea what you are doing, so I am guessing here.
Categorías
Más información sobre Timetables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!