intersect between a double and a (complicated) cell array

조회 수: 3 (최근 30일)
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 11월 6일
댓글: Ioannis Vourvachakis 2021년 11월 14일
I have a double array A
and I have a cell array B
I want to extract the values in array A, that also are contained in the sixth column of array B.
Ηow this can be achieved?
  댓글 수: 3
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 11월 6일
편집: Ioannis Vourvachakis 2021년 11월 6일
Yes you are right, the cell entries in the sixth column contain numbers (like the numbers in array A).
Yes, I just want to know the elements of A that appear anywhere in any entry in column 6.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2021년 11월 6일
col6_numerics = cell2mat(vertcat(YourCell{:,6}));
A_that_appear = A(ismember(A, col6_numerics));
  댓글 수: 2
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 11월 6일
Thank you very much!!
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 11월 14일
Hello! And if I want to know, the row of B, which elements of A appear in any cell entry in that row of column 6?

댓글을 달려면 로그인하십시오.

추가 답변 (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