MATLAB: Isnan cellfun and dropping rows

cell arraycellfunisnan

Hi, in my cell array X, I would like to drop all rows where the value of the 4th column is NaN (the new cell array is Y).
I am trying this:
Y = X(~any(cellfun(@isnan,X(:,4),'UniformOutput',false),2),:)
It returns the following error: Undefined function 'any' for input arguments of type 'cell'.
How do I have to change the code?

Best Answer

Making some guesses here, but this might do what you want:
Y = X(cellfun(@(x)any(isnan(x)),X(:,4)),:)