How to average this excel data, so that it retains all data but reduces in length?

조회 수: 3 (최근 30일)
Two different programs were used in recording two sets of data. They both used slightly different time intervals so that one program had 1,300 data points and the other program had 1,560 data points. Both data sets were of 130 seconds of recording. The program which recorded the 1,300 data points did it every millisecond, where as the other program seems to have recorded at a slightly faster interval.
Now, the .xls file which contains 1,560 data points must have only 1,300 data points, but points simply cannot be randomly deleted to achieve this. Is there a way to average the data evenly so that it reduces in size to 1,300?
Excuse me as I have only been using MATLAB for a few months. Thanks for all of the input!
  댓글 수: 3
Conor Dixon
Conor Dixon 2018년 7월 26일
Bob,
Thanks for the reply. The data is not roughly linear overall.
Bob Thompson
Bob Thompson 2018년 7월 26일
Is it some kind of vibration response, or fluctuation data? Basically, how much variation is there between two or three points?

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

채택된 답변

Conor Dixon
Conor Dixon 2018년 7월 26일
matrix = xlsread('filename')
n = 1.2;
NewTable = arrayfun(@(i) mean(matrix(i:i+n-1)),1:n:length(matrix)-n+1)';
NewTable = table(NewTable);
writetable(NewTable,'NewTable.csv');

추가 답변 (1개)

dpb
dpb 2018년 7월 26일
If you have Signal Processing TB, use
doc resample
Simple interpolation can be accomplished by interp1 or if you turn the data into timetable by using retime both of which have several choices of interpolation.

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by