Deleting zeros from cell matrix without resizing or reshaping matrix
조회 수: 25 (최근 30일)
이전 댓글 표시
I have a cell matrix like this
[1] [2] [6] [2] [6] [6] [1] [0] [0]
[1] [7] [2] [5] [0] [6] [4] [7] [1]
[3] [2] [0] [2] [6] [7] [4] [7] [3]
and i want to delete zeros without changing the size or shape of the cell matrix
this the result i want
[1] [2] [6] [2] [6] [6] [1] [] []
[1] [7] [2] [5] [] [6] [4] [7] [1]
[3] [2] [] [2] [6] [7] [4] [7] [3]
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2014년 12월 25일
편집: Azzi Abdelmalek
2014년 12월 25일
a={ 1 2 6 2 6 6 1 0 0;1 7 2 5 0 6 4 7 1;3 2 0 2 6 7 4 7 3 }
a(cellfun(@not,a))={[]}
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!