How can I extract a specific row from a table?
1 view (last 30 days)
Show older comments
Ashfaq Ahmed on 6 Feb 2023
Commented: Voss on 6 Feb 2023
Suppose I have a table with two column (i.e., Date and Temperature) like this -
Please note that every date has multiple temperature assign to it. Now, I have another array that has three dates -
How can I extract these three days from the previous table with all the associated temperature? I mean, I want a matrix that will have these three dates with all the temperatures. Thus, 9 columns.
I have attached the DateToFind.mat file in this question. Can any one please help?
Edited: Voss on 6 Feb 2023
result = T(ismember(T.Date,Date_to_find),:)
Then, if you want those temperatures in a matrix with 9 columns:
result = result.Temperature.'
More Answers (0)
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!