Comparing cell arrays of strings of unequal size/replacing missing values with zeroes
Show older comments
I have two cell arrays of strings of unequal size:
A = {'dog','cat'};
B = {'dog ','cat','fish ','horse'};
How can I compare A with B string-by-string and put a zero (0) where strings in B are not in A?
I would expect a result kind of that:
B = {'dog ','cat', 0, 0};
1 Comment
James Tursa
on 6 Mar 2015
+1 for showing an explicit example with expected result!
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings 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!