Setdiff n intersect question

1 回表示 (過去 30 日間)
Neesha
Neesha 2014 年 8 月 21 日
コメント済み: Neesha 2014 年 8 月 22 日
Hi,
I have two dataset.
1)
  • Shop# - floor#
  • 321 - 4
  • 321 - 2
  • 321 - 3
  • 322 - 0
  • 322 - 2
2)
  • shop# - floor#
  • 322 - 1
  • 322 - 0
  • 322 - 2
if i do intersect of those two, i expect following, but i get just first row. WHy? 3)
  • shop# - floor#
  • 322 - 0
  • 322 - 2

採用された回答

Guillaume
Guillaume 2014 年 8 月 21 日
>> a=[321 4;321 2;321 3;322 0;322 2];
>> b=[322 1;322 0;322 2];
>> intersect(a, b, 'rows')
ans =
322 0
322 2
  8 件のコメント
Matt J
Matt J 2014 年 8 月 22 日
@Neesha, if you got it work, you should accept Guillaume's answer
Neesha
Neesha 2014 年 8 月 22 日
i accepted it, but i did not end up using 'rows', it worked without it as problem was coming from somewhere else

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by