Deleting rows in Matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a large column vector (col1) I have the following code:
notcontacts=(col1(:,1)>600);
col1=col1.*notcontacts
Now I want to to delete all of the zeros that are in the column of data so i have the following (col2) which is only made up of the values that are greater than less than 600.
댓글 수: 3
답변 (1개)
Oleg Komarov
2012년 5월 9일
EDITED
idx = idx = col1(:,1) < 600 & col1(:,1) ~= 0;
col2 = col1(idx, 1);
댓글 수: 4
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!