Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how can i compare beteween two elements the first is cell and the second vector or class double in matlab?
조회 수: 1 (최근 30일)
이전 댓글 표시
Example:
S= {1 2 }
q= [ 1 2 3]
how compare each element of q exisit in S?
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 10월 29일
In the special case where each entry in S is a scalar, then
ismember(q,cell2mat(S))
If that is not the case, if S entries can be non-scalars, then you need to define what it means for there to be a match. For example, if S = {[1 2], 3} then should entries 1 and 2 match because they are somewhere in S, or should only 3 match because it is exactly the same as an entry in S ?
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!