Delete m consecutive rows every n rows
이전 댓글 표시
Hello! I'm looking to find a way to delete certain rows in a big table that i'm working with. I would like to find a smart way to delete m consecutive rows every n rows. In my case I have m=6 and n=24--> i want rows 25:30 to be erased while rows 31:54 preserved, up till the end. Hope that the question is clear. Thank you!
채택된 답변
추가 답변 (1개)
m = 6;
n = 24;
N = 87;
data = (1:N).'+(0:10:20); % some data
discard=repelem( [false;true] , [n;m], ceil(N/(m+n)) );
data(discard(1:N),:)=[]
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!