How can i find which value of a cell equals to 1?
조회 수: 11 (최근 30일)
이전 댓글 표시
Hi everbody,
I have a cell array includes [] and 1 elements and i want to find which cell equals to 1. (For ex. 220. cell equals 1.)
Thanks...
댓글 수: 0
채택된 답변
Massimo Zanetti
2016년 10월 7일
If in your cell you have only [] or 1 elements, this works.
C={1,[],[],1,[],1}
%get indeces of 1s
OnesInC = find(~cell2mat(cellfun( @(x) isempty(x) , C , 'UniformOutput' , false )))
Otherwise, let me know.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!