So I have a set of data with which I converted into a matrix. In this matrix I have to delete rows who's average is less than 50. I run a for loop like this:
filename = '/home/kelm/uegabe/Alle/Muringayi/Tactile Sensor Robot Measurements/S1M1/2017-7-18_111304.txt';m = importdata(filename);m(:,1) = [];for i = 1:size(m,1) avg = mean(m(i,:)); if avg < 50 m(i,:) = []; continue end end
However, all I get back is index exceeds matrix dimensions. I am also able to cut down on some of the rows who's average is less than fifty because the number of rows in my matrix goes from 717 to 426, but there are still more that remain. Does anyone know where I am going wrong and how I can delete the appropriate rows?
Best Answer