how to replace duplicates with mean value in a table
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Viktor G.
am 22 Jun. 2020
Kommentiert: Viktor G.
am 22 Jun. 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 Kommentare
Akzeptierte Antwort
madhan ravi
am 22 Jun. 2020
https://www.mathworks.com/help/matlab/ref/timetable.retime.html;jsessionid=187727437e865082a2118348467c#bve5nmz - use 'secondly' instead of 'hourly'
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!