How to plot data from a single day?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello everyone! I am currently a novice on the matlab world.
I have a table that goes as such:
"10-Jul-2019 -24.129 -40.848
10-Jul-2019 -24.129 -40.818
10-Jul-2019 -24.132 -40.512
10-Jul-2019 -24.132 -40.393
13-Jul-2019 -24.578 -40.304
14-Jul-2019 -24.675 -41.144
14-Jul-2019 -24.573 -40.959
14-Jul-2019 -24.573 -40.798
14-Jul-2019 -24.573 -40.798
14-Jul-2019 -24.574 -40.679
14-Jul-2019 -24.573 -40.569
14-Jul-2019 -24.574 -40.507
15-Jul-2019 -24.682 -40.93
17-Jul-2019 -24.761 -41.586 "
And I want to plot a different chart for each day.
Does anyone know how to do this?
Thanks!!
댓글 수: 0
채택된 답변
Star Strider
2019년 10월 25일
If ‘T1’ is your table, and y0ou defined it with a datetime array as the first column try this:
G = findgroups(day(T1{:,1}));
DayGroups = accumarray(G, (1:size(G,1))', [], @(x){T1(x,:)});
Example —
for k = 1:size(DayGroups,1)
figure(k)
plot(DayGroups{k}{:,1}, DayGroups{k}{:,2:end}, '-p')
grid
end
This worked with data that I already have in a similar table that I have already defined. I have no idea what your table actually is, or how you have defined it, so I cannot use the text that you posted.
댓글 수: 6
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Preprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!