interpolation for a matrix per row
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I have a 50x91 double in a structure for which I would like to interpolate each row and save as a 50 x 101.
My script works fine if I specify a specific row to interpolate, however I cannot solve to interpolate for each row.
My code is:
% Normalising walks to 101 data points
for j = 1:size(procfiles,1);
n1=size(RESULTS.Kinematics(j).data,2); %number of samples per walk
t0=linspace(1,n1,n1); %original time vector
t1=linspace(1,n1,101); %new time vector of 101 points
RESULTS.Kinematics(j).Resampled = interp1(t0,(RESULTS.Kinematics.data),t1,'linear');
end
Many thanks in advance.
Best wishes,
0 Commenti
Risposta accettata
Stephen23
il 12 Giu 2020
You forgot the indexing here:
interp1(t0,(RESULTS.Kinematics(j).data),t1,'linear')
% ^^^ missing
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!