Adjust measurement data with different vector lengths using interpolation
Mostrar comentarios más antiguos
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 comentarios
David Hill
el 26 de En. de 2021
Do you just want the mean of all your data? I don't understand your question.
mean([Vector1,Vector_2,Vector_3]);
Mepe
el 26 de En. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Large Files and Big Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!