フィルターのクリア

Intersection of two vector of string/char type

16 ビュー (過去 30 日間)
Mihai Milea
Mihai Milea 2020 年 11 月 29 日
コメント済み: Mihai Milea 2020 年 11 月 30 日
Hi.What is an analogue function for "intersect" when the vectors have string entries? For example A(1)='EDP PL',A(2)='VOD LN'. B(1)='VOD LN',B(2)='BNPP FP'.
If I have tow numerical vectors v1 and v2 I can find the intersection and the positions by simply [ig,ind1,ind2]=intersect(v1,v2).
How do I deal with this kind of situation ?
  3 件のコメント
Rik
Rik 2020 年 11 月 29 日
Your syntax is a bit confusing. Did you mean to use single quotes, or did you mean to use a string data type instead?
Mihai Milea
Mihai Milea 2020 年 11 月 30 日
Hi.I do not understand the first answer ...You intersect the first vector with what? There is just intersect(A) .. ,Yes string data not quotes

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

採用された回答

Walter Roberson
Walter Roberson 2020 年 11 月 30 日
[a, b, c] = intersect(["a1", "a2"], ["b1", "a1"])
  1 件のコメント
Mihai Milea
Mihai Milea 2020 年 11 月 30 日
Many thanks !

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by