MATLAB: Compare elements of two cell vectors

cell arrayscompare

Hi,
I have two cell vectors of different lengths, containing both numbers and numbers/characters.
Now, I want to delete all elements of vector A, which are not in vector B.
Best, Chris

Best Answer

I found a solution.
First I converted all elements of both cell arrays to strings with this code I found:
numIndex = cellfun('isclass', B, 'double');
tmpStr = sprintf('%g;', B{numIndex});
B(numIndex) = dataread('string', tmpStr, '%s', 'delimiter', ';');
Then I compared the arrays with
ismember(A,B)
Thanks all anyway.