Adjust measurement data with different vector lengths using interpolation
이전 댓글 표시
I have carried out various series of measurements from which I would like to form arithmetic mean values.
The problem is that one series of measurements has 1200 data points (Vector_1), the second only 1000 (Vector_2) and the third 800 data points (Vector_3).
I tried to adapt this to the largest vector using interpolation:
maxLength = max([length(Vector_1), length(Vector_2), length(Vector_2)]);
xFit = 1:maxLength;
IP_Vector_1 = interp1(1:length(Vector_1), Vector_1, xFit);
IP_Vector_2 = interp1(1:length(Vector_2), Vector_2, xFit);
IP_Vector_3 = interp1(1:length(Vector_3), Vector_3, xFit);
However, this code does not seem to distribute the interpolation evenly, but rather puts it at the end (with NaN). Does anyone have any idea what the problem is or have another suggestion how that could be solved elegantly in Matlab?
Many Thanks!
댓글 수: 2
David Hill
2021년 1월 26일
Do you just want the mean of all your data? I don't understand your question.
mean([Vector1,Vector_2,Vector_3]);
Mepe
2021년 1월 26일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!