1

There are two arrays:

   A=[2,6,9,10];
   B=[6,10,9,2,2,9,10,10,6,6,2,9];

I want to output the following array:

   C=[2,4,3,1,1,3,4,4,2,2,1,3];

How to do this work?

0

2 Answers 2

1

I found the solution, [~,C]=ismember(B,A);

Sign up to request clarification or add additional context in comments.

Comments

0

My answer shall be C=arrayfun(@(x) find(A==x),B)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.