Using Interp1 when data has duplicates
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Krishna Chaitanya Simma
am 4 Feb. 2019
Kommentiert: Tehreem Syed
am 11 Aug. 2022
Hi,
I am working with Timeseries data. Time vs Population in a building. I have data from two different sources for the space population. The plot is shown in the image attached. I need to interpolate these two plot lines to identify Y(population) values from both sources at regular intervals of X(Time) values (i.e. Population at 1-min increment in time). I tried interp1 but both my data sources have duplicates (as my population changed multiple times within a min). The time steps for both data sources dont match in the original data. I need to keep the duplicates as they are required data points. I am not sure how to work around this issue to obtain Y values from both sources at the same time-steps.
PS: I used clear 'x' and 'y' values and then reobtain x and y values but it only gives me the same data points that I used to plot.
Thanks for the help.

4 Kommentare
Kevin Phung
am 4 Feb. 2019
ok, but just to clarify, you want one line to describe both of those plots correct?
Akzeptierte Antwort
Krishna Chaitanya Simma
am 18 Feb. 2019
1 Kommentar
Tehreem Syed
am 11 Aug. 2022
Hey! I tried your methods but it's not working.
Attached you can see the snippet of my code.

Thank you :)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation 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!
