MATLAB: Find index of first nonempty cell in array

cell arrayempty cells

Hi,
I have a cell array with values and empty cells. I'd like to return the index of the first empty cell.
For example, for
A = [pizza] [pepperoni] [cheese] [] []
I'd like to return a value of 4.
Thanks!

Best Answer

A = {['pizza'] ['pepperoni'] ['cheese'] [] []}
find(cellfun(@isempty,A),1)