how to replace duplicates with mean value in a table
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Viktor G.
el 22 de Jun. de 2020
Comentada: Viktor G.
el 22 de Jun. de 2020
I need to have a single value for every second of the time. Is there a simpler method of solving this without making for or while loops that compare every value to each other and then store the means in other table?
Sample =
10×4 table
Date Time Angle Speed
__________ __________ _____ _____
01/02/2014 '00:00:00' 62 3.6
01/02/2014 '00:00:00' 62 3.8
01/02/2014 '00:00:01' 60 4.1
01/02/2014 '00:00:01' 59 4.2
01/02/2014 '00:00:02' 58 4.3
01/02/2014 '00:00:02' 60 4.3
01/02/2014 '00:00:02' 64 4.3
01/02/2014 '00:00:03' 63 4.3
01/02/2014 '00:00:03' 61 4.3
01/02/2014 '00:00:04' 61 4.3
What i should get from this is
Sample =
10×4 table
Date Time Angle Speed
__________ __________ _____ _____
01/02/2014 '00:00:00' 62 3.7
01/02/2014 '00:00:01' 60 4.2
01/02/2014 '00:00:02' 61 4.3
01/02/2014 '00:00:03' 62 4.3
01/02/2014 '00:00:04' 61 4.3
0 comentarios
Respuesta aceptada
madhan ravi
el 22 de Jun. de 2020
https://www.mathworks.com/help/matlab/ref/timetable.retime.html;jsessionid=187727437e865082a2118348467c#bve5nmz - use 'secondly' instead of 'hourly'
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!