Fill table field based on field values from another table
Show older comments
I want to move values from one table to a different table based on matching field names across both tables. I'm hoping to do so without using costly for loops, as the dataset is fairly large. I've tried using ismember and field indexing, but it seems so clunky and I can't get it to work.
In the example below, Tables A and B already exist and both have the field "ID". Table A may have other fields, but new fields are trying to be added. The goal is to fill "NewField1", "NewField2", and "NewField3" in Table A based on the corresponding fields in Table B. In the image below, the yellow cells indicate fields I'd like to be filled.

This is exceptionally straightforward in Excel with VLOOKUP, but I'm having trouble finding an efficient analog in MATLAB.
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!