フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

spliting a vector based on another vector

1 回表示 (過去 30 日間)
John Kim
John Kim 2016 年 11 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Dear all, I have two vectors, A and B. I want to split A into two vectors, C1 and C2, where C1 contains elements of A that are also in B and C2 contains elements of A that are NOT in B. Clearly, I can do C1 = intersect(A,B); C2 = setdiff(A,C1); but it looks cumbersome. Is there a one liner, something like [C1,C2] = f(A,B)? I'd much appreciate any and all help. Thanks so much! Best, John

回答 (1 件)

Matt J
Matt J 2016 年 11 月 10 日
編集済み: Matt J 2016 年 11 月 10 日
Is there a one liner, something like [C1,C2] = f(A,B)?
There will be once you write such a function f(), which you can easily do!

この質問は閉じられています。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by