Quantcast
Channel: Webby Expert
Viewing all articles
Browse latest Browse all 10

How to find the occurences of the elements of first cell array in second cell array in MATLAB?

$
0
0

I have two cell arrays:

A={‘abc’,’pai”,’abd’,’pa/n/v/d’}

B={‘pai-pro’,’abc’,’pai”,’abd/’,’abd’,’pa/n/v/d’,’abd-‘,’pa/n/v/d’,’pai-pro’}

I need a code to find the occurence of the elements of A in B. Such that the output would be:

‘abc’ = 1

‘pai” = 3

‘abd’ = 3

‘pa/n/v/d’ = 2


Viewing all articles
Browse latest Browse all 10

Trending Articles