Delete zero columns in images
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
majed majed
le 27 Mar 2016
Commenté : majed majed
le 28 Mar 2016
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 commentaires
Réponse acceptée
Azzi Abdelmalek
le 27 Mar 2016
Modifié(e) : Azzi Abdelmalek
le 27 Mar 2016
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))
Plus de réponses (1)
Muhammad Usman Saleem
le 27 Mar 2016
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
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!