How to extract rows by date?
古いコメントを表示
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 件のコメント
Jan
2018 年 5 月 12 日
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
2018 年 5 月 12 日
採用された回答
その他の回答 (1 件)
Star Strider
2018 年 5 月 12 日
1 投票
I have no idea what you are doing, so I am guessing here.
カテゴリ
ヘルプ センター および File Exchange で Timetables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!