Output score which is nearest to image date
Show older comments
I have 2 tables - a source table and a score table.
My source table contains an ID number with an image at a certain date.
My score table contains a matching ID number with multiple scores with an associated date.
How do I find the score for the correct ID that is nearest in time to my Image_date?
How do I also output the distance in months from the Image_date of the score to another table?
Source table:
ID Image_date
4270 17/11/2011
4999 02/04/2014
Score table:
ID Score_date Score
4270 21/09/2011 30
4270 01/08/2012 29
4270 15/03/2014 27
4999 01/01/2011 24
4999 01/01/2014 20
Desired source and score table:
ID Image_date Nearest_score Months_from_Image
4270 17/11/2011
4999 02/04/2014
Desired distance table:
D Score_date Score Months_from_image
4270 21/09/2011 30
4270 01/08/2012 29
4270 15/03/2014 27
4999 01/01/2011 24
4999 01/01/2014 20
Any help would me most welcome if you have the time?
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Object Properties 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!