필터 지우기
필터 지우기

how to delete column with one number only

조회 수: 2 (최근 30일)
nadia nadi
nadia nadi 2016년 4월 21일
댓글: nadia nadi 2016년 4월 25일
Dear All,
I need to delete the columns with only one element from this matrix,
A =[1 1 1 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 1
0 0 0 0 1
0 0 1 0 0];
I used some command find with loop but it is not correct, is there any efficient idea.
thanks in advance.
Nadia,

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 21일
편집: Azzi Abdelmalek 2016년 4월 21일
A(:,sum(A)==1)=[]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by