如何找到细胞的坐标

how find coordinates of cells

例如我有一个:

1x11 cell
 [] []  3   []  []  []  []  []  1   []  []

如何找到非空单元格的坐标?

喜欢res=[1,3;1,9]

应用函数isempty to each cell's contents via cellfun, and then get the column and row indices of the cells that gave false (that is, were not empty) using the two-output version of find:

x = {[] []  3   []  []  []  []  []  1   []  []}
[ii, jj] = find(~cellfun(@isempty, x))
res = [ii(:) jj(:)];