Second problem uitable
조회 수: 1 (최근 30일)
이전 댓글 표시
i have another problem similarly with before:
m=3; d=5; b=num2cell(zeros(m,d)); b{1,1} = rand; b{1,6} = rand; b{2,7} = rand;
how can I save the 0 filled cells and random number filled cells differently?
댓글 수: 0
채택된 답변
Walter Roberson
2011년 11월 2일
iszero = cellfun(@(p) isequal(p,0),b);
Now you can find(iszero) or find(~iszero) or use b(~iszero)
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!