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 中查找有关 Logical 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

