Find the different elements in a cell array

3 次查看(过去 30 天)
Hi to all,
i have a problem because i have a cell array and i need to find the cells that contain both numbers 1 and 2.
Thanks.

采纳的回答

Stephen23
Stephen23 2021-11-23
编辑:Stephen23 2021-11-23
Where out is your cell array:
fnh = @(v) any(v(:)==1)&&any(v(:)==2);
idx = cellfun(fnh,out)
  12 个评论
Stephen23
Stephen23 2021-11-29
@Lidia Frizzi: please show the expected result of that "merging".
LL
LL 2021-11-29
So for example in the rows 6-7 and colums 8-9 i have three cells not empty the result that i would like to obtain is like this.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by