Let's say I have two arrays:
a = [1 0 0 1];b = {'ada', 'bob', 'carl', 'dana'};
where the first is a numerical array of zeros and ones, and the second is a cell array of character arrays. How can I achieve the following result:
{'ada','dana'}
where the resulting cell array only contains the elements based on the one values in a?
Best Answer