MATLAB: Cell array: select only 1×3 double cells

cell arraycell arraysMATLAB

Hi everyone,
i have a 1×4 cell array like this:
{[0.1]} {1×3 double} {[0.02]} {1×3 double}
and i want to extract only the 1×3 double cells (of which I do not know the exact location into cell array).
Thank's a lot!
Riccardo Rossi

Best Answer

Where C is your cell array:
X = cellfun('length',C)==3;
out = C(X)