Fill table field based on field values from another table
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!