Compare two arrays of different lengths and return logical

11 views (last 30 days)
Hello,
If I have A = [1, 2, 3, 4] and B = [2, 4], how can I have C return logical 1 and 0 for all elements of A so that C is the size of A?

Answers (1)

KSSV
KSSV on 27 Oct 2021
Read about ismember.

Categories

Find more on Data Types in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!