Interpolating matrices of different sizes to the same size
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ase U
am 15 Aug. 2018
Kommentiert: Pieter Hamming
am 15 Aug. 2018
Hello,
i have two signals and i want to equalize sizes of my signals because i try to find the time lag in between. Size of first signal is [4001 1], second is [1 180]. But i don't want to just remove some elements from first signal. It should be have almost same curve like in this photo. I think that i need something about interpolation and i tried this code but it show me just same value always, not like interpolation.
targetSize = [1 180];
signal_new = imresize(signal, targetSize);
Any idea? I am very appreciated for your answers, thank you!
3 Kommentare
Pieter Hamming
am 15 Aug. 2018
Others have given alternatives such as interp1, but if you want to use timetable, can you give me an example of your data?
Akzeptierte Antwort
Weitere Antworten (1)
Anthony Barone
am 15 Aug. 2018
interp1 will do what you want. I find that using it with the 'pchip' flag is particularly useful.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!