Finding Corresponding Data at Events
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Krispy Scripts
am 2 Apr. 2016
Kommentiert: Star Strider
am 6 Apr. 2016
I have a matrix with data in one column and corresponding time intervals in the next column. Another matrix has event times. I am wanting to get the data from the first matrix that corresponds to the event time. I feel like this is simple, but I am having issues choosing the right way to go about this. The data is continuous so I want to make sure that I am getting a good approximation of the data when event times are between intervals.
4 Kommentare
Akzeptierte Antwort
Star Strider
am 5 Apr. 2016
There are only three rows that exactly correspond:
D1 = load('Heath Robinson Matrix1.mat');
D2 = load('Heath Robinson Matrix2.mat');
M1 = D1.Matrix1;
M2 = D2.matrix2;
[CommonTimes, ia, ib] = intersect(M1(:,2),M2);
DesiredResult = M1(ia,:)
DesiredResult =
0.0027084 0.045775
-0.083389 0.23977
0.051537 0.25477
4 Kommentare
Star Strider
am 6 Apr. 2016
My pleasure.
I left a Comment requesting further clarification, since it’s still not clear to me.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Numeric Types 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!