Interpolate between columns within matrix to remove glitched data
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
demos serghiou
am 26 Okt. 2022
Kommentiert: Mathieu NOE
am 26 Okt. 2022
Hi, I have a complex matrix where some colums contain glitched data. If columns 25,26 contains glitched data, how can I interpolate between the data in columns 24 and 27 in order to replace columns 25 and 26 within the matrix with the interpolated data?
Thanks
1 Kommentar
Mathieu NOE
am 26 Okt. 2022
hello
have you tried with
if your situation needs more than this advice maybe you should share the data / code that goes along to shw the issue(s)
Akzeptierte Antwort
Voss
am 26 Okt. 2022
% a random matrix with 27 columns:
data = rand(10,27);
% glitch columns 25 and 26:
data(:,[25 26]) = NaN;
% show columns 24 to 27 for reference:
data(:,24:27)
% interpolate based on columns 24 and 27 to get new values for columns 25 and 26:
data(:,[25 26]) = interp1([1 4],data(:,[24 27]).',[2 3]).';
% show new columns 24 to 27:
data(:,24:27)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!