How do I delete certain parts of a cell array and interpolate it when needed? Without using signal processing toolbox.

3 visualizaciones (últimos 30 días)
Hello.
I have a cell array of 8 rotation speed with its measured values. (20000:-2500:2500)rpm
I want to shrink the size of each array from 8192 into 2048. Which means, I only want to take the 1st, 5th, 9th, etc values. Because later, I want to interpolate the missing values and see how different it is. For example, I want to get the the 3rd value of the rotation speed of 3750rpm by interpolating the missing values of the shrinked array. Any ideas on how to do so?
Originally, what I did with the original cell array was:
% a is the cell array with the measured values
q = 20000:-2500:2500;
interval = abs(interval);
f = floor(input_rotation/interval);
lower = f * interval;
upper = (f+1) * interval;
for i = 1:Start_i_len
if lower == q(i)
i_lower = i;
end
if upper == q(i)
i_upper = i;
end
end
Offset_diff = a{i_upper} - a{i_lower};
Offset_diff_drehzahl = Offset_diff / (q(i_upper) - q(i_lower));
n = input_rotation - q(i_lower);
Offset_input_rotation = a{i_lower} + (n * Offset_diff_rotation);
Thank you very much!

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Mzo. de 2022
cellfun() resample()

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by