I want to find the position of cells with a specific content, but the empty cells are not counted, so I take a wrong result of position
조회 수: 1 (최근 30일)
이전 댓글 표시
I have the cell array a.
This cell array is a 1603 * 1 cell array .
I want to find the cells that contain 'svinw to ena zeugos', so this is what I did:
b=find(ismember([a{:,1}],{'svinw to ena zeugos'}));
But the rows that are empty (only contain [] ) are not counted, so the array b finds wrong rows that contain 'svinw to ena zeugos'.
What can I do?
댓글 수: 0
답변 (1개)
Star Strider
2021년 11월 11일
The ‘b’ variable will contain the numeric indices from the logical vector that ismember returns, so ‘a{b,1}’ should return the desired results.
Lv = randi([0 1], 1, 10) == 1
Nv = find((Lv))
.
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!