Matrix sorting re-size problem

Hi everyone, Lets say i have a matrix a=[1 2 3; 1 0 3; 2 3 5; 1 0 5] like that i have 1000 rows. Now i want to remove the rows whose second column element is 0. i.e. if(a(i,2)==0) then remove it. Pls help me out of this. Thanks

 채택된 답변

Srinivas
Srinivas 2012년 11월 9일

0 개 추천

a(a(:,2) ==0,:) = []

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by