Find the different elements in a cell array

조회 수: 2 (최근 30일)
LL
LL 2021년 11월 23일
댓글: LL 2021년 11월 29일
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에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by