MATLAB: I need to remove every other 9 rows of a matrix

MATLABremove certian rowsremove n rowsremove rowsremove rows from a matrix

This should be simple but its giving me some trouble. I have a matrix of 57 rows and 3 columns. This matrix is a condensed set of data from 3 data sets with 19 rows of data each. The first 9 rows of each individual data sets are unneeded and need to be removed. So in the full matrix I need to remove the first 9 rows of data, move down 10 rows, remove the next 9 rows of data, move down another 10 rows, and the remove the next 9 rows of data. Does anyone know how I can do this?

Best Answer

How about this?
r = 57; % total rows
c = 3; % total columns
d = 19; % rows in each data set
n = 9; % remove first n rows in each data set
A = cumsum(ones(r,c)); % example data
A(mod(1:r,d)<=n & mod(1:r,d)>0,:) = [];