Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays matlab中阵列单元的显示_Arrays_Matlab - Fatal编程技术网

Arrays matlab中阵列单元的显示

Arrays matlab中阵列单元的显示,arrays,matlab,Arrays,Matlab,所以我写了一段代码来创建我的单元格数组。我可以显示数组,但我对如何只显示包含某些内容的单元格有点迷茫。我有44个细胞,但其中只有4个有任何东西。这是我到目前为止所拥有的 hashtags = regexpi(z,'\<(#)[a-z0-9_]*\>','match'); celldisp(hashtags) hashtags=regexpi(z,'\','match'); celldisp(哈希标签) 这显示了整个阵列,我所需要的是四个单元格,其中有一些内容 使用cellfun检

所以我写了一段代码来创建我的单元格数组。我可以显示数组,但我对如何只显示包含某些内容的单元格有点迷茫。我有44个细胞,但其中只有4个有任何东西。这是我到目前为止所拥有的

hashtags = regexpi(z,'\<(#)[a-z0-9_]*\>','match');
celldisp(hashtags)
hashtags=regexpi(z,'\','match');
celldisp(哈希标签)

这显示了整个阵列,我所需要的是四个单元格,其中有一些内容

使用
cellfun
检查每个单元格是否为空,并将其用作逻辑索引:

celldisp(hashtags(~cellfun('isempty',hashtags)))

使用
cellfun
检查每个单元格是否为空,并将其用作逻辑索引:

celldisp(hashtags(~cellfun('isempty',hashtags)))