converting 1 hourly data to 3 hourly data
显示 更早的评论
I have file of excel with date,hour,waveheight i need to convert avg of three hourly data set i.e each day i will get 8x3(8 data sets) instead of 24x1 (24 data sets) can anyone help me out in writing code since i am new to matlab. attached file also.
Any kind of help will be useful for me
thanks
janakiram
1 个评论
darova
2019-9-27
Can you please show what you have done already?
回答(1 个)
Ajay Kumar
2019-9-27
编辑:Ajay Kumar
2019-9-27
data = xlsread('www3');
data = data(:,2);
j=1;
try
for i = 1: fix(length(data))
newdata(i) = mean(data(j:j+2));
j=j+3;
end
catch
end
newdata = newdata';
new data has 2912 values. Each is average of 3 hours of original data.
2 个评论
janakiram Reddy
2019-9-27
Ajay Kumar
2019-9-27
编辑:Ajay Kumar
2019-9-27
My pleasure.
Please accept the answer if you got what you need. Thanks :)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!