MATLAB: Index Non-Empty Cells in Cell Array

arrayarrayscellcellsemptyfindindexindexingnonempty

Hi,
I have the following cell array
TEST = [1] [] [] [] []
I want to get the index position of the non-empty cell. I know I can do this using a loop, but is there any single command (like "find") that will do this?
Thank you!
JF

Best Answer

x = {1,[],[],[]};
find(~cellfun(@isempty,x))