%% Intersection of Char and Cell Array of Character Vectors
% Create a character vector containing animal names that have three letters.

A = ['dog';'cat';'fox';'pig'];
class(A)

%
% Create a cell array of character vectors containing animal names of varying lengths.

B = {'cat','dog','fish','horse'};
class(B)

%
% Find the character vectors common to both A and B.

C = intersect(A,B)

%
% The result, C, is a cell array of character vectors.

class(C)

% Copyright 2012 The MathWorks, Inc.