How to compare two different excel sheets specific columns for like values

조회 수: 11 (최근 30일)
Tyler Ginet
Tyler Ginet . 2022년 1월 21일
댓글: Tyler Ginet . 2022년 1월 24일
I am trying to compare two excel files, specifically a column in each. The cells contain numbers and letters and arent in order. I am trying to update a condensed list to ensure that it has the master's values. It has been a few years since ive used MATLAB. I tried using the setdiff function to compare arrays from each with no luck. TIA!
  댓글 수: 7
Tyler Ginet
Tyler Ginet 2022년 1월 24일
I tried both C and D. Unfortunately that didnt work. Thank you though!

댓글을 달려면 로그인하십시오.

답변 (1개)

Ive J
Ive J 2022년 1월 22일
xlsread is deprecated, avoid it.
fullTab = readtable('File1.xlsx');
denseTab = readtable('File2.xlsx');
[idxFull, idxDense] = ismember(fullTab.(13), denseTab.(3));
idxDense(idxDense < 1) = [];
fullCol13Unique = A.(13)(~idxFull);


Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by