mean vaue every one minute
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Thar
am 20 Sep. 2016
Kommentiert: Thar
am 20 Sep. 2016
Hi all!
I have a matrix with two columns, time and temperature. I want to find mean value of temperature for every 1 minute. Because my time is on hours every 0.0166. my matrix is:
12.3539 25.8
12.3537 24.9
12.3590 25.1
12.3624 25.3
12.3692 24.5
12.3726 26.2
12.3777 26.1
12.3811 26.8
12.3861 27.4
I want to find mean value from 1-5 and the from 6-9 and so on, until 2897.
Are there any ideas?
Thank you!
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 20 Sep. 2016
data = [12.3539 25.8
12.3537 24.9
12.3590 25.1
12.3624 25.3
12.3692 24.5
12.3726 26.2
12.3777 26.1
12.3811 26.8
12.3861 27.4];
t = 1/60;
th = [0;cumsum(diff(data(:,1)))];
ii = floor(abs(th)/t)+1;
T = accumarray(ii,data(:,2),[],@mean);
3 Kommentare
Andrei Bobrov
am 20 Sep. 2016
Bearbeitet: Andrei Bobrov
am 20 Sep. 2016
Hi Thodoris! Please give small part your data (use 'attach').
Weitere Antworten (1)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!