10 minutes average for four hours data

조회 수: 1 (최근 30일)
PRIYA
PRIYA 2012년 10월 29일
3793.197 3793.19735 3793.1977 3793.19805 3793.1984 3793.19875 3793.1991 3793.19945 3793.1998 3793.20015 3793.2005 3793.20085 3793.2012 3793.20155 3793.2019 3793.20225 3793.2026 3793.20295 3793.2033 3793.20365 3793.204 3793.20435........etc i have a data set for four hours....these datas are taken in 15 seconds interval and for four hours i will have 720 datas .....for the first hour i need to calculate average for first 10 minutes and remaining 50 minutes no need to calculate average and again for second hour, first 10 minutes i need to calculate average and so on til the completion of four hours.......since i m a beginner in matlab .....i need a help sir to write a matlab code for 10 minutes average for four hours data....
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 10월 29일
Please do not name individuals in your Tags. Please retag this question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
PRIYA
PRIYA 2012년 10월 30일
SORRY its 3 hours data

댓글을 달려면 로그인하십시오.

채택된 답변

Pedro Villena
Pedro Villena 2012년 10월 29일
nHours = 4; %number of hours
Ts = 15; %sampling period [s]
data = [3793.197... %your data is 960x1 size
%data = rand(nHours*3600/Ts,1); %test data (4hours*3600second/15second)
meanT = 10*60; %test period [s]
matrix = reshape(data,3600/Ts,nHours);
out = mean(matrix(1:meanT/Ts,:));

추가 답변 (2개)

Sachin Ganjare
Sachin Ganjare 2012년 10월 29일
A=rand(960,1);
A=reshape(A,240,4);
A_OUT=mean(A(1:40,:))

Sachin Ganjare
Sachin Ganjare 2012년 10월 30일
A=rand(720,1);
A=reshape(A,240,3);
A_OUT=mean(A(1:40,:))
  댓글 수: 3
PRIYA
PRIYA 2012년 10월 30일
actually i m doing project regarding tsunami.....i need to collect tsunami data for 4 hours and each data will be taken for 15 seconds so for each minute i will have 4 data and for 4 hours 960 datas and i need to take average for first 10 minutes(i.e 40 data) in each hour and in second hour average of first 10 minutes and so on till 4th hour and i will get 4 average values and i need to apply those 4 average values in one formula that is Hp(t') = SUMMATION i=0 to 3 (w(i) H*(t-idt)) and weights is w(0) = 1.16818457031250 w(1) = -0.28197558593750 w(2) = 0.14689746093750 w(3) = -0.03310644531250 and the link for the above formula is (<http://www.ndbc.noaa.gov/dart/algorithm.shtml>) from this i will get Hp(t') value which is 961 value and again from 2 to 961 value i need to repeat the same procedure to get 962 value lik that we need to calculate for 5000 values , its like moving average ... for this process i need to create matlab code
Andrei Bobrov
Andrei Bobrov 2012년 10월 30일
A=rand(720,1);
A=reshape(A,240,[]);
A_OUT=mean(A(1:40,:));

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by