- Duplicates in the data. An element that occurs more than once among the MyData(i) will only result in one output
- Duplicates in the i values have the same effect.
- NaN == NaN is never true, so the results of intersect() remove all NaN
A general question about intersect
1 回表示 (過去 30 日間)
古いコメントを表示
Hello -
I have a general question. I can provide specifics if needed.
How is it possible for
size(intersect(MyData(i),MyData))
to be not equal to
size(i)
Put another way, how can the intersect of a subset of a vector and the original vector not be the entire subset of the vector? I seem to have a case where it is and I can't understand how that can be. It seems impossible, by defintion.
Thanks.
0 件のコメント
採用された回答
Walter Roberson
2019 年 11 月 10 日
その他の回答 (1 件)
Image Analyst
2019 年 11 月 10 日
Because one element, MyData(i), does not necessarily match every single element of MyData. For example 2 will match only 1 element of this three element vector [1, 2, 3]. It matches only element #2 and does not match element #1 or element #3 so the length will be only 1, NOT 3.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!