MATLAB: Comparing columns and returning 0s for matching values

comparing values

I have two columns in two separate tables:
T1 - Col A T2 - Col A
1 1
2 4
3 ` 5
4
5
I am looking to create in table 1 a column B containing zeros for those matching values between T1-colA and T2-colA.
The result will look like
T1 - Col A T1 - Col B
1 0
2
3 `
4 0
5 0
How could I accomplish this efficiently?

Best Answer

is it a table that you have or an array? Have you looked into ismember to see if this does what you want?
doc ismember