How to extract the values of two datasets from the same date/time from two table ?
Show older comments
Dear all.
I have two big data sets with .mat format, each contains a table (an example of my data can be seen below). My real data are attached.
I would like to extract the values from the same date/time and also when the value of the third column of the second table is 40.
I am getting a little bit confusing to do all steps together.
date time tem wind
__________ ________ ______ ____
2015.06.05 05:10:00 16.677 0.74
2015.06.05 05:20:00 16.773 1.67
2015.06.05 05:30:00 16.915 1.3
2015.06.05 05:40:00 17.534 0.93
2015.06.05 05:50:00 18.2 0.37
t z height speed
__________ ________ ______ _____
2016-02-01 10:00:00 40 0.93
2016-02-01 10:00:00 50 NaN
2016-02-01 10:00:00 60 0.93
2016-02-01 10:00:00 70 1.65
2016-02-01 10:00:00 80 2.03
I know how to extract the data of the second table when the values of the third column is 40.
height = 40 ;
k = sodar_wind{:,3}== height ;
date = sodar_wind{:,1}(k);
time = sodar_wind{:,2}(k);
high = sodar_wind{:,3}(k);
Wind = sodar_wind{:,4}(k);
I appreciate if you could assist.
1 Comment
Greg
on 27 May 2018
Try ismember or intersect.
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!