how to delete column with one number only

1 visualización (últimos 30 días)
nadia nadi
nadia nadi el 21 de Abr. de 2016
Comentada: nadia nadi el 25 de Abr. de 2016
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,

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 21 de Abr. de 2016
Editada: Azzi Abdelmalek el 21 de Abr. de 2016
A(:,sum(A)==1)=[]

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by