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!