Delete zero columns in images
조회 수: 2 (최근 30일)
이전 댓글 표시
How are you everyone! I need your help to solve this problem :
If I have an image which contains columns with all elements equal to zero , how can delete the columns?
For example , if I have the image
A= [ 1 0 2 3 4 ;0 0 5 4 3 ;5 0 7 6 5;3 0 4 3 0]
How can I delete the second column ? The result I want is
AA=[1 2 3 4 ;0 5 4 3 ;5 7 6 5 ;3 4 3 0]
Any answer will be appreciated Thank you.
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2016년 3월 27일
편집: Azzi Abdelmalek
2016년 3월 27일
A= [ 1 0 2 3 4 ;0 0 5 4 3 ;5 0 7 6 5;3 0 4 3 0]
AA=A(:,any(A))
댓글 수: 2
추가 답변 (1개)
Muhammad Usman Saleem
2016년 3월 27일
A= [ 1 0 2 3 4 ;0 0 5 4 3 ;5 0 7 6 5;3 0 4 3 0]
A =
1 0 2 3 4
0 0 5 4 3
5 0 7 6 5
3 0 4 3 0
A(:,2)=[];
A =
1 2 3 4
0 5 4 3
5 7 6 5
3 4 3 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!