Extract data corresponding to particular dates
    7 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Sayantan Sahu
 el 18 de Nov. de 2022
  
    
    
    
    
    Comentada: Star Strider
      
      
 el 19 de Nov. de 2022
            I have csv file that contains a variable data every minute along with datetime in the format '2019-01-01 00:00'.
I want to select all data corresponding to particular dates say 12th Jan, 19th Jan, 24th March.
I imported the csv file using readtable and then converted it to timetable. However I am not sure how to select all data corresponding to particular dates. Every selected day should contain 24x60 data values.
0 comentarios
Respuesta aceptada
  Star Strider
      
      
 el 19 de Nov. de 2022
        Therea re likely several ways to do this.  
DT = table(datetime('now')+days(0:364).', 'VariableNames',{'DateTime'});
Data = array2table(randn(365,4));
T1 = [DT Data]
[y,m,d] = ymd(T1.DateTime);
query = [1 12; 1 19; 3 24];
Lv = ismember([m d], query, 'rows');
Result = T1(Lv,:)
.
2 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Dates and Time en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

