How do I calculate 30 minute average from 10 minute data??

1 view (last 30 days)
I have excel file 10 minute data. 1st column is date and time and 2nd onward data. From 10 minute data, I want to calculate 30 minute average. For reference please find attachment of input file and out put file.
  3 Comments
S SNO
S SNO on 23 Jan 2017
Edited: S SNO on 23 Jan 2017
I am beginner to do programing in matlab. No I not import the Excel files to Matlab. I want result in excel file. I have 7516 row and 24 column in my original excel file. i don't want moving average.
Image Analyst
Image Analyst on 23 Jan 2017
I don't understand. Do you or do you not have an original Excel file that you want to import into MATLAB with xlsread()? After you process your numbers in MATLAB (regardless of how they got there), do you or do you not want to export them to an Excel workbook with xlswrite()?
And how do you propose to compute means of 30 minute sections if you don't use a moving mean?

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 23 Jan 2017
Edited: Image Analyst on 21 Oct 2020
Nothing was attached. You can use movmean() or conv()
smoothedData = conv(data, [1, 1, 1] / 3, 'same');
  2 Comments
DINUMOL VARGHESE
DINUMOL VARGHESE on 21 Oct 2020
Sir, i imported the power curve from excel and i need to do moving average in matlab and show the results.how is it possible
Image Analyst
Image Analyst on 21 Oct 2020
You can use my code above, or use the newer movmean().
To show the results, why not use plot()?

Sign in to comment.


Jan
Jan on 23 Jan 2017
If you really want to use an Excel file as input and as output, it would be much easier to do this in Excel: http://www.excel-easy.com/examples/moving-average.html

Community Treasure Hunt

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

Start Hunting!